/* DEVDIY Theme Manager — preset page */
.ddtm-preset-page {
	--ddtm-primary: #008060;
	--ddtm-primary-hover: #006e52;
	--ddtm-ink: #1a1a1a;
	--ddtm-muted: #6b6b6b;
	--ddtm-preview-bg: #1a1a1a;
	--ddtm-preview-bg-deep: #0a0a0a;
	--ddtm-radius: 12px;
	--ddtm-max: 1120px;
}

.ddtm-preset-wrap {
	font-family: inherit;
	color: var(--ddtm-ink);
	background: #fff;
}

/* Break out of theme .ast-container so topbar/preview can be true 100vw */
.ddtm-preset-page #content,
.ddtm-preset-page .site-content {
	overflow-x: clip;
}

.ddtm-preset-page .ast-container {
	max-width: none !important;
	width: 100% !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

.ddtm-preset-wrap {
	width: 100%;
	max-width: none;
}

.ddtm-topbar,
.ddtm-preview {
	width: 100%;
	max-width: none;
	box-sizing: border-box;
}

/* Preview stage */
.ddtm-preview__stage {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0 120px;
	box-sizing: border-box;
}

.ddtm-preview__desktop img {
	border-radius: 20px;
	border: solid 0.05rem #888;
}


.ddtm-topbar {
	position: sticky;
	top: 0;
	z-index: 100;
	width: 100%;
	max-width: none;
	background: #1a1a1a;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ddtm-topbar__inner {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 20px 80px 12px;
	border-bottom: solid 1px #555;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	box-sizing: border-box;
}

.ddtm-topbar__logo {
	font-weight: 700;
	font-size: 1rem;
	letter-spacing: -0.02em;
	color: #fff;
	text-decoration: none;
}

.ddtm-topbar__logo:hover {
	color: rgba(255, 255, 255, 0.9);
}

.ddtm-topbar__browse {
	font-size: 0.9375rem;
	color: rgba(255, 255, 255, 0.65);
	text-decoration: none;
	font-weight: 550;
}

.ddtm-topbar__browse:hover {
	color: #fff;
	text-decoration: underline;
}

/* Preview — full bleed */
.ddtm-preview {
	position: relative;
	width: 100%;
	max-width: none;
	background: linear-gradient(180deg, var(--ddtm-preview-bg) 0%, var(--ddtm-preview-bg-deep) 100%);
	padding: 1.5rem 0 5.5rem;
	min-height: 70vh;
	box-sizing: border-box;
}

.ddtm-preview__toggles {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	margin-bottom: 1.25rem;
}

.ddtm-preview__toggle {
	appearance: none;
	border: 0;
	background: transparent;
	color: rgba(255, 255, 255, 0.45);
	cursor: pointer;
	padding: 0.4rem 0.55rem;
	border-radius: 8px;
	transition: color 0.2s ease, background 0.2s ease;
}

.ddtm-preview__toggle:hover {
	color: rgba(255, 255, 255, 0.85);
}

.ddtm-preview__toggle.is-active {
	color: #fff;
	background: rgba(255, 255, 255, 0.1);
}

.ddtm-preview__stage {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0 120px;
	box-sizing: border-box;
}

.ddtm-preview__desktop,
.ddtm-preview__mobile {
	display: none;
}

.ddtm-preview__desktop.is-visible,
.ddtm-preview__mobile.is-visible {
	display: block;
}

.ddtm-preview__desktop img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 20px;
	border: solid 0.05rem #888;
	box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.ddtm-preview__mobile {
	text-align: center;
}

.ddtm-phone-frame {
	display: inline-block;
	width: min(375px, 88vw);
	border-radius: 28px;
	overflow: hidden;
	background: #111;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), inset 0 0 0 2px rgba(255, 255, 255, 0.08);
	padding: 10px;
}

.ddtm-phone-frame img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 20px;
}

.ddtm-preview__placeholder {
	color: rgba(255, 255, 255, 0.5);
	text-align: center;
	padding: 4rem 1rem;
}

/* Floating action bar */
.ddtm-floatbar {
	position: sticky;
	bottom: 1.25rem;
	z-index: 40;
	max-width: 720px;
	margin: -3.25rem auto 0;
	padding: 0.65rem 0.75rem 0.65rem 1.25rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	background: #fff;
	border-radius: 999px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
}

.ddtm-floatbar__meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.65rem 1rem;
	min-width: 0;
}

.ddtm-floatbar__name {
	font-weight: 700;
	font-size: 1rem;
	letter-spacing: -0.02em;
}

.ddtm-floatbar__price {
	color: var(--ddtm-muted);
	font-size: 0.9375rem;
}

.ddtm-floatbar__rating {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	font-size: 0.875rem;
	color: var(--ddtm-ink);
}

.ddtm-floatbar__rating svg {
	color: var(--ddtm-primary);
}

.ddtm-floatbar__actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-shrink: 0;
}

.ddtm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.55rem 1.1rem;
	border-radius: 999px;
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
	white-space: nowrap;
}

.ddtm-btn--ghost {
	color: var(--ddtm-ink);
	border: 1px solid rgba(0, 0, 0, 0.15);
	background: #fff;
}

.ddtm-btn--ghost:hover {
	border-color: var(--ddtm-primary);
	color: var(--ddtm-primary);
}

.ddtm-btn--primary {
	background: var(--ddtm-primary);
	color: #fff;
	border: 1px solid transparent;
}

.ddtm-btn--primary:hover {
	background: var(--ddtm-primary-hover);
	color: #fff;
}

/* Presets gallery — overlapping deck */
.ddtm-presets-gallery {
	--ddtm-card-w: 230px;
	--ddtm-card-overlap: 95px;   /* default stack: ~135px peek per card */
	--ddtm-card-spread: 42px;    /* hover 平铺: ~188px peek, more breathing room */
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 3.5rem 80px 2.5rem;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 2.5rem;
	background: #fff;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.ddtm-presets-gallery__label {
	flex: 0 0 240px;
	max-width: 260px;
	min-width: 0;
}

.ddtm-presets-gallery__icon {
	display: flex;
	color: var(--ddtm-ink);
	margin-bottom: 1rem;
}

.ddtm-presets-gallery__title {
	margin: 0 0 0.5rem;
	font-size: clamp(1.75rem, 2.5vw, 2.125rem);
	font-weight: 700;
	letter-spacing: -0.03em;
	line-height: 1.15;
	color: var(--ddtm-ink);
}

.ddtm-presets-gallery__subtitle {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: var(--ddtm-muted);
	max-width: 18rem;
}

.ddtm-presets-gallery__deck {
	flex: 1 1 auto;
	display: flex;
	align-items: flex-end;
	justify-content: flex-end;
	position: relative;
	min-height: 320px;
	min-width: 0;
	padding-bottom: 1.75rem;
}

.ddtm-presets-gallery__card {
	position: relative;
	flex: 0 0 auto;
	width: var(--ddtm-card-w);
	max-width: min(var(--ddtm-card-w), 28vw);
	aspect-ratio: 3 / 4;
	border-radius: 24px;
	text-decoration: none;
	color: inherit;
	/* px overlap (not % of deck) so stack stays grand, not crushed */
	margin-left: calc(-1 * var(--ddtm-card-overlap));
	z-index: calc(1 + var(--ddtm-card-i, 0));
	transition:
		margin-left 0.4s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
		box-shadow 0.35s ease,
		z-index 0s linear 0.05s;
	transform-origin: center bottom;
	will-change: transform, margin-left;
}

.ddtm-presets-gallery__card:first-child {
	margin-left: 0;
}

.ddtm-presets-gallery__card-media {
	position: relative;
	width: 100%;
	height: 100%;
	border-radius: inherit;
	overflow: hidden;
	background: #f0f0f0;
	box-shadow:
		0 4px 6px rgba(0, 0, 0, 0.04),
		0 12px 28px rgba(0, 0, 0, 0.12);
	transition: box-shadow 0.35s ease;
}

.ddtm-presets-gallery__card-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
}

.ddtm-presets-gallery__card-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 1rem;
	text-align: center;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--ddtm-muted);
	box-sizing: border-box;
}

/* Edge checkmark — only used when a non-active card is focused during spread */
.ddtm-presets-gallery__check {
	position: absolute;
	top: 42%;
	left: -2px;
	z-index: 3;
	display: none;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #111;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
	pointer-events: none;
	transform: translate(-35%, -50%);
}

/* Centered selected check (图2) — always visible on active card */
.ddtm-presets-gallery__check-lg {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.ddtm-presets-gallery__card.is-active .ddtm-presets-gallery__check-lg {
	opacity: 1;
}

.ddtm-presets-gallery__check-lg svg {
	width: 56px;
	height: 56px;
	padding: 14px;
	box-sizing: border-box;
	border-radius: 50%;
	background: #111;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}

.ddtm-presets-gallery__card-name {
	position: absolute;
	left: 50%;
	bottom: -1.65rem;
	transform: translateX(-50%);
	white-space: nowrap;
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--ddtm-ink);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
}

/* Section hover / focus: 平铺展开 with wider distribution */
.ddtm-presets-gallery:hover .ddtm-presets-gallery__card,
.ddtm-presets-gallery:focus-within .ddtm-presets-gallery__card {
	margin-left: calc(-1 * var(--ddtm-card-spread));
}

.ddtm-presets-gallery:hover .ddtm-presets-gallery__card:first-child,
.ddtm-presets-gallery:focus-within .ddtm-presets-gallery__card:first-child {
	margin-left: 0;
}

/* When a non-active card is hovered during spread, hide active overlay check */
.ddtm-presets-gallery:hover .ddtm-presets-gallery__deck:has(.ddtm-presets-gallery__card:not(.is-active):hover)
	.ddtm-presets-gallery__card.is-active .ddtm-presets-gallery__check-lg,
.ddtm-presets-gallery:focus-within .ddtm-presets-gallery__deck:has(.ddtm-presets-gallery__card:not(.is-active):focus-visible)
	.ddtm-presets-gallery__card.is-active .ddtm-presets-gallery__check-lg {
	opacity: 0;
}

.ddtm-presets-gallery:hover .ddtm-presets-gallery__deck:has(.ddtm-presets-gallery__card:not(.is-active):hover)
	.ddtm-presets-gallery__card.is-active .ddtm-presets-gallery__check,
.ddtm-presets-gallery:focus-within .ddtm-presets-gallery__deck:has(.ddtm-presets-gallery__card:not(.is-active):focus-visible)
	.ddtm-presets-gallery__card.is-active .ddtm-presets-gallery__check {
	display: flex;
}

/* 图3 — focus one card: scale up, name below */
.ddtm-presets-gallery__card:hover,
.ddtm-presets-gallery__card:focus-visible {
	z-index: 20;
	transform: scale(1.06);
	transition:
		margin-left 0.4s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
		box-shadow 0.35s ease,
		z-index 0s;
}

.ddtm-presets-gallery__card:hover .ddtm-presets-gallery__card-media,
.ddtm-presets-gallery__card:focus-visible .ddtm-presets-gallery__card-media {
	box-shadow:
		0 8px 16px rgba(0, 0, 0, 0.08),
		0 20px 40px rgba(0, 0, 0, 0.18);
}

.ddtm-presets-gallery__card:hover .ddtm-presets-gallery__card-name,
.ddtm-presets-gallery__card:focus-visible .ddtm-presets-gallery__card-name {
	opacity: 1;
}

/* Hide large overlay on the card being hovered if it's active — name takes priority */
.ddtm-presets-gallery__card.is-active:hover .ddtm-presets-gallery__check-lg,
.ddtm-presets-gallery__card.is-active:focus-visible .ddtm-presets-gallery__check-lg {
	opacity: 0;
}

.ddtm-presets-gallery__card.is-active:hover .ddtm-presets-gallery__check,
.ddtm-presets-gallery__card.is-active:focus-visible .ddtm-presets-gallery__check {
	display: flex;
}

.ddtm-presets-gallery__card:focus-visible {
	outline: 2px solid var(--ddtm-primary);
	outline-offset: 3px;
}

/* Highlights + other sections: 80px side padding */
.ddtm-highlights {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 4rem 80px 3rem;
	box-sizing: border-box;
}

.ddtm-highlights__intro {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 2rem;
	margin-bottom: 3rem;
	flex-wrap: wrap;
}

.ddtm-highlights__title {
	margin: 0 0 0.5rem;
	font-size: clamp(1.75rem, 3vw, 2.25rem);
	font-weight: 700;
	letter-spacing: -0.03em;
	line-height: 1.15;
}

.ddtm-highlights__slogan {
	margin: 0;
	max-width: 36rem;
	font-size: 1.125rem;
	line-height: 1.5;
	color: var(--ddtm-muted);
}

.ddtm-highlights__right {
	text-align: right;
}

.ddtm-highlights__price {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 650;
}

.ddtm-highlights__by {
	margin: 0.25rem 0 0;
	color: var(--ddtm-muted);
	font-size: 0.9375rem;
}

.ddtm-highlights__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2.5rem 2rem;
}

.ddtm-highlight {
	margin: 0;
}

.ddtm-highlight img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 8px;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	background: #f3f3f3;
}

.ddtm-highlight__video {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: 8px;
	overflow: hidden;
	background: #111;
}

.ddtm-highlight__video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.ddtm-highlight figcaption h3 {
	margin: 1rem 0 0.4rem;
	font-size: 1.05rem;
	font-weight: 650;
	letter-spacing: -0.01em;
}

.ddtm-highlight figcaption p {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.55;
	color: var(--ddtm-muted);
}

/* Features + support / submission */
.ddtm-features,
.ddtm-support,
.ddtm-submission {
	border-top: 1px solid rgba(0, 0, 0, 0.06);
	width: 100%;
	max-width: none;
	padding: 3.5rem 80px;
	box-sizing: border-box;
}

.ddtm-features {
	padding: 2.25rem 80px;
}

.ddtm-section-inner {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
}

.ddtm-section-title {
	margin: 0 0 1.5rem;
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: -0.02em;
}

.ddtm-features .ddtm-section-title {
	margin: 0 0 1rem;
}

.ddtm-features__columns {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1.5rem 2rem;
	align-items: start;
}

.ddtm-features__col {
	min-width: 0;
}

.ddtm-features__col-title {
	margin: 0 0 0.55rem;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--ddtm-ink);
	line-height: 1.3;
}

.ddtm-features__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.ddtm-features__list li {
	margin: 0;
	padding: 0;
	font-size: 0.9375rem;
	font-weight: 400;
	line-height: 1.35;
	color: var(--ddtm-muted);
	background: none;
	border-radius: 0;
}

/* Stores / support */
.ddtm-stores {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1.25rem;
	margin-bottom: 2.5rem;
}

.ddtm-store {
	text-decoration: none;
	color: inherit;
}

.ddtm-store img {
	display: block;
	width: 100%;
	border-radius: 8px;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	margin-bottom: 0.5rem;
}

.ddtm-store span {
	font-size: 0.9375rem;
	font-weight: 550;
}

.ddtm-support__links {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.ddtm-support__links a {
	color: var(--ddtm-primary);
	text-decoration: none;
}

.ddtm-support__links a:hover {
	text-decoration: underline;
}

.ddtm-submission__instructions {
	margin-top: 1rem;
	line-height: 1.6;
	color: var(--ddtm-muted);
	white-space: pre-wrap;
}

/* Lightbox */
.ddtm-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: rgba(0, 0, 0, 0.85);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem;
}

.ddtm-lightbox[hidden] {
	display: none !important;
}

.ddtm-lightbox img {
	max-width: min(960px, 100%);
	max-height: 90vh;
	border-radius: 8px;
}

/* Beat theme global `button` / `button:hover` in devdiy-brand.css
   (green #008060 / primary-hover + border-radius: 999px pill). */
.ddtm-preset-page .ddtm-lightbox__close,
.ddtm-preset-page .ddtm-lightbox__close:hover,
.ddtm-preset-page .ddtm-lightbox__close:focus,
.ddtm-preset-page .ddtm-lightbox__close:focus-visible,
.ddtm-preset-page .ddtm-lightbox__close:active,
.ddtm-lightbox .ddtm-lightbox__close,
.ddtm-lightbox .ddtm-lightbox__close:hover,
.ddtm-lightbox .ddtm-lightbox__close:focus,
.ddtm-lightbox .ddtm-lightbox__close:focus-visible,
.ddtm-lightbox .ddtm-lightbox__close:active {
	position: absolute;
	top: 1rem;
	right: 1.25rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0 !important;
	background: transparent !important;
	background-color: transparent !important;
	box-shadow: none !important;
	border-radius: 0 !important;
	outline: none;
	color: #fff !important;
	font-size: 2rem;
	cursor: pointer;
	line-height: 1;
	text-decoration: none !important;
	/* Reset theme translate/scale that causes green pill look; allow rotate below. */
	transform: none;
	transform-origin: center center;
	transition: transform 0.3s ease;
}

.ddtm-preset-page .ddtm-lightbox__close:hover,
.ddtm-preset-page .ddtm-lightbox__close:focus-visible,
.ddtm-lightbox .ddtm-lightbox__close:hover,
.ddtm-lightbox .ddtm-lightbox__close:focus-visible {
	transform: rotate(90deg);
}

@media (max-width: 900px) {
	.ddtm-presets-gallery {
		--ddtm-card-w: 150px;
		--ddtm-card-overlap: 62px;
		--ddtm-card-spread: 28px;
		flex-direction: column;
		align-items: flex-start;
		padding: 2.5rem 20px 2rem;
		gap: 1.75rem;
	}

	.ddtm-presets-gallery__label {
		flex: none;
		max-width: none;
	}

	.ddtm-presets-gallery__subtitle {
		max-width: none;
	}

	.ddtm-presets-gallery__deck {
		width: 100%;
		justify-content: center;
		min-height: 240px;
		overflow-x: auto;
		overflow-y: visible;
		-webkit-overflow-scrolling: touch;
		padding-left: 0.5rem;
		padding-right: 1rem;
	}

	.ddtm-presets-gallery__card {
		max-width: none;
	}

	.ddtm-highlights {
		padding-left: 20px;
		padding-right: 20px;
	}

	.ddtm-features,
	.ddtm-support,
	.ddtm-submission {
		padding-left: 20px;
		padding-right: 20px;
	}

	.ddtm-features {
		padding-top: 1.75rem;
		padding-bottom: 1.75rem;
	}

	.ddtm-features .ddtm-section-title {
		margin-bottom: 0.75rem;
	}

	.ddtm-features__columns {
		grid-template-columns: 1fr;
		gap: 1.15rem;
	}

	.ddtm-features__col-title {
		margin-bottom: 0.4rem;
	}

	.ddtm-features__list {
		gap: 0.3rem;
	}

	.ddtm-features__list li {
		line-height: 1.3;
	}

	.ddtm-highlights__grid {
		grid-template-columns: 1fr;
		gap: 2rem;
	}

	.ddtm-highlights__right {
		text-align: left;
	}

	.ddtm-floatbar {
		border-radius: 16px;
		margin-left: 0.75rem;
		margin-right: 0.75rem;
		padding: 0.85rem 1rem;
	}

	.ddtm-floatbar__actions {
		width: 100%;
	}

	.ddtm-floatbar__actions .ddtm-btn {
		flex: 1;
	}
}

@media (max-width: 600px) {
	.ddtm-topbar__inner {
		padding-left: 20px;
		padding-right: 20px;
	}

	.ddtm-preview__stage {
		padding-left: 16px;
		padding-right: 16px;
	}
}
