/* css-shadow — 新版工具頁（對齊全站 app.css / color-converter 佈局） */

.shadow-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;
}

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

.shadow-work-toolbar .shadow-toolbar-modes {
	flex: 0 0 auto;
	min-width: 0;
}

.shadow-mode-group .btn {
	white-space: nowrap;
}

.shadow-toolbar-actions {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
	flex-wrap: nowrap;
}

.shadow-work-toolbar .btn.btn-sm {
	height: 34px;
	padding-top: 0;
	padding-bottom: 0;
	white-space: nowrap;
}

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

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

.shadow-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;
}

.shadow-editor-wrap .editor-panel {
	min-height: 0;
}

.shadow-layers-body {
	padding: 14px 16px 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	flex: 1;
	min-height: 0;
}

.shadow-layers-stack {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-height: min(62vh, 640px);
	overflow-y: auto;
	padding-right: 2px;
}

.shadow-preview-body {
	padding: 14px 16px 16px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	flex: 1;
}

.shadow-preview-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
}

.shadow-preview-head .form-label,
.shadow-output-head .editor-panel-label {
	margin-bottom: 0;
}

.shadow-bg-row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.shadow-bg-row .small {
	color: var(--c-text-2);
	font-weight: 600;
}

.layer-card {
	border: 1.5px solid var(--c-border);
	border-radius: 12px;
	padding: 1rem 1.1rem 0.9rem;
	background: var(--c-surface);
	position: relative;
}

.layer-badge {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	padding: 0.18rem 0.55rem;
	border-radius: 1rem;
	background: var(--c-surface-2);
	color: var(--c-text-2);
}

.color-swatch-wrap {
	display: inline-flex;
	align-items: center;
	width: 2.4rem;
	height: 2.4rem;
	border-radius: 0.4rem;
	border: 2px solid var(--c-border);
	overflow: hidden;
	cursor: pointer;
	flex-shrink: 0;
}

.color-swatch-wrap input[type="color"] {
	width: 160%;
	height: 160%;
	margin: -30%;
	border: none;
	cursor: pointer;
	background: none;
	padding: 0;
}

#shadow-preview-area {
	min-height: 160px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
	border: 1px solid var(--c-border);
	background: var(--c-surface-2);
}

#shadow-preview-box {
	width: 130px;
	height: 90px;
	border-radius: 0.6rem;
	background: var(--c-surface);
	transition: box-shadow 0.15s;
	display: flex;
	align-items: center;
	justify-content: center;
}

#shadow-preview-text {
	font-size: 2rem;
	font-weight: 800;
	line-height: 1.1;
	color: #222;
	transition: text-shadow 0.15s;
}

[data-bs-theme="dark"] #shadow-preview-text {
	color: #eee;
}

#shadow-css-output {
	font-family: var(--bs-font-monospace, ui-monospace, monospace);
	font-size: 0.85rem;
	resize: vertical;
	min-height: 72px;
}

.shadow-range-val {
	min-width: 3.2rem;
	text-align: right;
	font-size: 0.85rem;
	color: var(--c-text-2);
}

.shadow-output-block {
	border-top: 1px solid var(--c-border);
	margin: 0 -16px -16px;
	padding: 14px 16px 16px;
	background: var(--c-surface-2);
	border-radius: 0 0 12px 12px;
}

.shadow-output-head {
	margin-bottom: 8px;
}

.shadow-info-section .tabs-nav {
	margin-bottom: 0;
}

.shadow-usage-note {
	margin-top: 16px;
	font-size: 0.86rem;
	color: var(--c-text-2);
	margin-bottom: 0;
}

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

.shadow-faq-list .faq-q {
	padding: 12px 14px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	font-weight: 600;
	font-size: 0.92rem;
}

.shadow-faq-list .faq-q i {
	transition: transform 0.2s ease;
	color: var(--c-text-2);
}

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

.shadow-faq-list .faq-a {
	display: none;
	padding: 0 14px 14px;
	font-size: 0.88rem;
	color: var(--c-text-2);
	line-height: 1.6;
}

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

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

	.shadow-flow-bridge {
		min-height: 36px;
	}

	.shadow-layers-stack {
		max-height: none;
	}
}

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

	.shadow-toolbar-actions {
		margin-left: 0;
		width: 100%;
		justify-content: flex-end;
	}
}
