/**
 * 文章反馈条 — modal / 按钮壳（字号尽量用 rem，对齐设计 token）
 * 条本身的排版字色优先靠 PHP/JS 里的 text-subhead / text-ink 等 Tailwind 类
 */

:root {
	--mytheme-fb-ink: #222222;
	--mytheme-fb-ink-secondary: #666666;
	--mytheme-fb-ink-tertiary: #999999;
	--mytheme-fb-primary: #e03030;
	--mytheme-fb-primary-600: #c52a2a;
	--mytheme-fb-primary-soft: #fdf5f5;
	--mytheme-fb-line: #e5e7eb; /* gray-200，对齐 btn-tool-secondary */
	--mytheme-fb-line-soft: #ededed;
	--mytheme-fb-radius: 0.5rem;
	/* 对齐 text-footnote / caption / subhead / body */
	--mytheme-fb-fs-footnote: 0.8125rem;
	--mytheme-fb-fs-caption: 0.875rem;
	--mytheme-fb-fs-subhead: 0.9375rem;
	--mytheme-fb-fs-body: 1rem;
}

.mytheme-fb {
	text-align: center;
}

.mytheme-fb__actions {
	justify-content: center;
}

.mytheme-fb__btn.is-done {
	opacity: 0.55;
	cursor: default;
}

/* 对齐工具卡「官网下载 / 开源地址」：h-8 扁胶囊 + rounded-full */
.mytheme-fb__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.375rem;
	height: 2rem; /* h-8 */
	min-height: 2rem;
	padding: 0 0.875rem; /* ≈ px-3.5，略扁长 */
	border: 1px solid var(--mytheme-fb-line);
	border-radius: 9999px;
	background: #fff;
	color: var(--mytheme-fb-ink);
	font-size: var(--mytheme-fb-fs-subhead);
	font-weight: 500;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.mytheme-fb__btn:hover {
	border-color: #d1d5db; /* gray-300 */
	background: #f9fafb; /* gray-50 */
}

.mytheme-fb__btn:focus-visible {
	outline: 2px solid rgba(224, 48, 48, 0.25);
	outline-offset: 2px;
}

.mytheme-fb__btn:disabled,
.mytheme-fb__btn.is-loading {
	opacity: 0.65;
	cursor: not-allowed;
}

.mytheme-fb__btn--resolved {
	border-color: var(--mytheme-fb-line);
	color: var(--mytheme-fb-ink);
	background: #fff;
}

.mytheme-fb__btn--resolved:hover:not(:disabled) {
	background: var(--mytheme-fb-primary-soft);
	border-color: #f0c4c4;
	color: var(--mytheme-fb-primary);
}

.mytheme-fb__btn--unresolved:hover:not(:disabled) {
	background: #f9fafb;
	border-color: #d1d5db;
}

.mytheme-fb__btn--icon {
	width: 2rem;
	min-width: 2rem;
	height: 2rem;
	padding: 0;
	color: var(--mytheme-fb-ink-secondary);
}

.mytheme-fb__btn--icon:hover:not(:disabled) {
	color: var(--mytheme-fb-primary);
	border-color: #f0c4c4;
	background: var(--mytheme-fb-primary-soft);
}

.mytheme-fb__btn--primary {
	border-color: var(--mytheme-fb-primary);
	background: var(--mytheme-fb-primary);
	color: #fff;
}

.mytheme-fb__btn--primary:hover:not(:disabled) {
	background: var(--mytheme-fb-primary-600);
	border-color: var(--mytheme-fb-primary-600);
	color: #fff;
}

.mytheme-fb__btn--ghost {
	background: #fff;
	color: var(--mytheme-fb-ink-secondary);
	border-radius: 9999px;
}

.mytheme-fb__icon {
	display: block;
	flex-shrink: 0;
	width: 0.875rem; /* 14px，对齐 btn-tool svg */
	height: 0.875rem;
}


/* Modal */
.mytheme-fb-modal {
	position: fixed;
	inset: 0;
	z-index: 100050;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	box-sizing: border-box;
}

.mytheme-fb-modal[hidden] {
	display: none !important;
}

.mytheme-fb-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
}

.mytheme-fb-modal__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 27.5rem;
	max-height: calc(100vh - 2rem);
	overflow: auto;
	overscroll-behavior: contain;
	padding: 1.375rem 1.375rem 1.125rem;
	background: #fff;
	border-radius: 0.75rem;
	box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.12);
	box-sizing: border-box;
}

.mytheme-fb-modal__close {
	position: absolute;
	top: 0.625rem;
	right: 0.625rem;
	width: 2.25rem;
	height: 2.25rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: var(--mytheme-fb-radius);
	background: transparent;
	color: var(--mytheme-fb-ink-tertiary);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.mytheme-fb-modal__close:hover {
	color: var(--mytheme-fb-ink);
	background: #f5f5f5;
}

.mytheme-fb-modal__close:focus-visible {
	outline: 2px solid #111111;
	outline-offset: 2px;
}

.mytheme-fb-modal__title {
	margin: 0 2.25rem 1rem 0;
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--mytheme-fb-ink);
	line-height: 1.35;
}

.mytheme-fb-modal__label {
	display: block;
	margin: 0 0 0.5rem;
	font-size: var(--mytheme-fb-fs-caption);
	font-weight: 500;
	color: var(--mytheme-fb-ink);
}

.mytheme-fb-modal__reasons {
	margin-bottom: 1rem;
}

.mytheme-fb-modal__reason-list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.mytheme-fb-modal__reason {
	display: flex;
	align-items: flex-start;
	gap: 0.625rem;
	margin: 0;
	padding: 0.625rem 0.75rem;
	border: 1px solid var(--mytheme-fb-line-soft);
	border-radius: var(--mytheme-fb-radius);
	background: #fff;
	font-size: var(--mytheme-fb-fs-caption);
	color: var(--mytheme-fb-ink);
	line-height: 1.4;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.mytheme-fb-modal__reason:hover {
	border-color: #cccccc;
	background: #fafafa;
}

.mytheme-fb-modal__reason:has(input:checked) {
	border-color: var(--mytheme-fb-primary);
	background: var(--mytheme-fb-primary-soft);
}

.mytheme-fb-modal__reason input {
	margin: 0.125rem 0 0;
	accent-color: var(--mytheme-fb-primary);
	flex-shrink: 0;
}

.mytheme-fb-modal__field {
	margin-bottom: 0.875rem;
}

.mytheme-fb-modal__textarea {
	display: block;
	width: 100%;
	min-height: 6rem;
	padding: 0.625rem 0.75rem;
	border: 1px solid var(--mytheme-fb-line);
	border-radius: var(--mytheme-fb-radius);
	background: #fff;
	color: var(--mytheme-fb-ink);
	/* ≥16px：避免 iOS 聚焦放大 */
	font-size: var(--mytheme-fb-fs-body);
	line-height: 1.5;
	resize: vertical;
	box-sizing: border-box;
}

.mytheme-fb-modal__textarea:focus {
	outline: none;
	border-color: #111111;
}

.mytheme-fb-modal__error {
	margin: 0 0 0.75rem;
	font-size: var(--mytheme-fb-fs-footnote);
	color: var(--mytheme-fb-primary);
	line-height: 1.4;
}

.mytheme-fb-modal__footer {
	display: flex;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: 0.625rem;
	margin-top: 0.25rem;
}

body.mytheme-fb-modal-open {
	overflow: hidden;
}

.mytheme-fb-toast {
	position: fixed;
	left: 50%;
	bottom: 1.75rem;
	z-index: 100060;
	transform: translateX(-50%);
	max-width: calc(100vw - 2rem);
	padding: 0.625rem 1rem;
	border-radius: var(--mytheme-fb-radius);
	background: rgba(34, 34, 34, 0.92);
	color: #fff;
	font-size: var(--mytheme-fb-fs-caption);
	line-height: 1.4;
	box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.18);
	pointer-events: none;
}

.mytheme-fb-toast[hidden] {
	display: none !important;
}

@media (max-width: 640px) {
	.mytheme-fb-modal {
		align-items: flex-end;
		padding: 0;
	}

	.mytheme-fb-modal__dialog {
		max-width: none;
		max-height: 90vh;
		border-radius: 0.75rem 0.75rem 0 0;
		padding: 1.25rem 1rem 1rem;
	}

	.mytheme-fb-modal__footer .mytheme-fb__btn {
		flex: 1;
		min-width: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mytheme-fb__btn,
	.mytheme-fb-modal__reason {
		transition: none;
	}
}
