/* contrast-checker — 新版工具頁（對齊 json-formatter / color-mixer 版型） */

.contrast-tool-header {
	margin-bottom: 24px;
}

.tool-header-actions {
	display: none !important;
}

.tool-top-ad-primary {
	margin: 16px 0 20px;
}

.tool-top-ad-secondary {
	margin: 20px 0;
}

.contrast-work-toolbar {
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
	gap: 8px;
	padding-top: 12px;
	margin-bottom: 0;
	min-width: 0;
}

.contrast-toolbar-start {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 1 auto;
	min-width: 0;
	overflow-x: auto;
	scrollbar-width: thin;
	-webkit-overflow-scrolling: touch;
}

.contrast-work-toolbar .toolbar-group .tb-btn {
	white-space: nowrap;
	flex: 0 0 auto;
}

.contrast-editor-wrap {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	gap: 12px;
	align-items: stretch;
	margin-bottom: 12px;
}

.contrast-flow-bridge {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	align-self: stretch;
}

.contrast-flow-arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	border: 1px solid var(--c-border);
	background: var(--c-surface-2);
	color: var(--c-text-2);
	font-size: 1.25rem;
}

.contrast-editor-panel .editor-panel-header {
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.contrast-panel-body {
	padding: 14px 16px 18px;
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.contrast-panel-hint {
	font-size: 0.82rem;
	color: var(--c-text-2);
	line-height: 1.55;
}

.contrast-secondary-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	gap: 12px;
	margin-bottom: 12px;
	align-items: stretch;
}

.contrast-tips-panel {
	margin-bottom: 12px;
}

.cc-color-swatch {
	width: 52px;
	height: 44px;
	padding: 3px;
	border-radius: 8px;
	cursor: pointer;
	border: 1.5px solid var(--c-border-strong);
	background: none;
	flex-shrink: 0;
}

.cc-ratio-display {
	font-size: 3.2rem;
	font-weight: 800;
	line-height: 1;
	letter-spacing: -2px;
}

.cc-ratio-unit {
	font-size: 1.1rem;
	font-weight: 600;
	color: var(--c-text-2);
	margin-left: 2px;
}

.cc-wcag-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.38rem 0.85rem;
	border-radius: 2rem;
	font-size: 0.86rem;
	font-weight: 600;
}

.cc-wcag-pass {
	background: rgba(22, 163, 74, 0.13);
	color: #15803d;
}

.cc-wcag-fail {
	background: rgba(220, 38, 38, 0.1);
	color: #b91c1c;
}

[data-bs-theme="dark"] .cc-wcag-pass {
	background: rgba(34, 197, 94, 0.18);
	color: #6ed4a0;
}

[data-bs-theme="dark"] .cc-wcag-fail {
	background: rgba(248, 113, 113, 0.15);
	color: #fca5a5;
}

.cc-preview-box {
	border-radius: 12px;
	padding: 1.75rem 2rem;
	min-height: 150px;
	transition: background-color 0.25s, color 0.25s;
	border: 1.5px solid var(--c-border-strong);
}

.cc-preview-normal {
	font-size: 1rem;
	margin-bottom: 0.5rem;
}

.cc-preview-large {
	font-size: 1.5rem;
	margin-bottom: 0.5rem;
}

.cc-preview-bold {
	font-size: 1.167rem;
	font-weight: 700;
}

.cc-suggest-swatch {
	width: 30px;
	height: 30px;
	border-radius: 6px;
	border: 1.5px solid var(--c-border-strong);
	flex-shrink: 0;
	cursor: pointer;
	transition: transform 0.15s, box-shadow 0.15s;
	padding: 0;
	background: none;
}

.cc-suggest-swatch:hover {
	transform: scale(1.18);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.cc-rating-track {
	height: 10px;
	border-radius: 5px;
	background: linear-gradient(
		to right,
		#e05252 0%,
		#e05252 14.3%,
		#f0a832 14.3%,
		#f0a832 28.6%,
		#2b9e5a 28.6%,
		#2b9e5a 55%,
		#1a6e9f 55%,
		#1a6e9f 100%
	);
	position: relative;
}

.cc-rating-marker {
	position: absolute;
	top: -5px;
	width: 4px;
	height: 20px;
	background: var(--c-surface);
	border: 2px solid var(--c-text);
	border-radius: 2px;
	transform: translateX(-50%);
	transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cc-preset-dot {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	cursor: pointer;
	transition: transform 0.15s, box-shadow 0.15s;
	flex-shrink: 0;
	border: none;
	padding: 0;
}

.cc-preset-dot:hover {
	transform: scale(1.22);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.cc-suggest-apply-btn {
	font-size: 0.76rem;
	padding: 0.15rem 0.5rem;
}

.contrast-info-section {
	margin-top: 34px !important;
	padding-top: 28px !important;
}

.contrast-faq-list .faq-item {
	border-radius: var(--radius);
	border: 1px solid var(--c-border);
	overflow: hidden;
	margin-bottom: 8px;
	background: var(--c-surface);
}

.contrast-faq-list .faq-a {
	display: none;
	padding: 0 18px 16px;
	font-size: 0.86rem;
	color: var(--c-text-2);
	line-height: 1.7;
	border-top: 1px solid var(--c-border);
	background: var(--c-surface);
}

.contrast-faq-list .faq-item.is-open .faq-a {
	display: block;
}

.contrast-faq-list .faq-item .faq-q i {
	transition: transform 0.2s ease;
}

.contrast-faq-list .faq-item.is-open .faq-q i {
	transform: rotate(180deg);
}

@media (max-width: 900px) {
	.contrast-editor-wrap {
		grid-template-columns: 1fr;
	}

	.contrast-flow-bridge {
		display: none;
	}

	.contrast-secondary-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 576px) {
	.contrast-work-toolbar {
		flex-wrap: wrap;
	}
}
