:root {
    --bg: #ffffff;
    --bg-warm: #f7f9fc;
    --paper: #ffffff;
    --paper-deep: #eef2f8;
    --ink: #090d1a;
    --muted: #697386;
    --soft: #9aa3b2;
    --line: #e7ebf2;
    --line-strong: #d6ddea;
    --black: #111111;
    --brown: #7b61ff;
    --sage: #55c77a;
    --lavender: #8d6bff;
    --danger: #b66161;
    --shadow: 0 24px 70px rgba(24, 35, 66, 0.10);
    --shadow-soft: 0 14px 38px rgba(24, 35, 66, 0.08);
    --radius: 16px;
    --radius-sm: 12px;
    --max: 1220px;
    --transition: 180ms ease;
    --visual-pet: url("assets/awesome-gpt-image-2/data/images/case417.jpg");
    --visual-child: url("assets/awesome-gpt-image-2/data/images/case452.jpg");
    --visual-product: url("assets/awesome-gpt-image-2/data/images/case475.jpg");
    --visual-avatar: url("assets/awesome-gpt-image-2/data/images/case378.jpg");
    --visual-poster: url("assets/awesome-gpt-image-2/data/images/case343.jpg");
    --visual-video: url("assets/awesome-gpt-image-2/data/images/case111.jpg");
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "HarmonyOS Sans SC", "MiSans", "Alibaba PuHuiTi 3.0", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 14% 16%, rgba(141, 107, 255, 0.10), transparent 26%),
        radial-gradient(circle at 88% 16%, rgba(94, 167, 255, 0.10), transparent 24%),
        var(--bg);
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.34;
    background-image: radial-gradient(circle, rgba(123, 97, 255, 0.16) 1px, transparent 1.5px);
    background-size: 18px 18px;
    mask-image: linear-gradient(to bottom, black, transparent 70%);
    z-index: -1;
}

a,
button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
}

img {
    max-width: 100%;
}

.container {
    width: min(var(--max), calc(100% - 48px));
    margin: 0 auto;
}

.section {
    padding: 72px 0;
}

.section-soft {
    padding: 108px 0 64px;
}

.section-paper {
    background: rgba(249, 251, 255, 0.72);
    border-block: 1px solid rgba(231, 235, 242, 0.9);
}

.navbar {
    position: fixed;
    inset: 0 0 auto 0;
    height: 72px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(231, 235, 242, 0.92);
    z-index: 1000;
}

.nav-container {
    width: min(var(--max), calc(100% - 40px));
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 0;
    white-space: nowrap;
}

.logo-mark {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    color: #fff;
    background: var(--black);
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(17, 17, 17, 0.18);
    overflow: hidden;
    flex: 0 0 auto;
}

.logo-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0 auto;
    padding: 0;
}

.nav-links a {
    display: block;
    padding: 9px 12px;
    color: var(--muted);
    border-radius: 999px;
    font-size: 14px;
    transition: color var(--transition), background var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--ink);
    background: #f1ebe1;
}

.nav-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-register-btn {
    white-space: nowrap;
}

.mobile-menu {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
}

.mobile-menu span {
    display: block;
    width: 18px;
    height: 1.5px;
    background: var(--ink);
    margin: 5px auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 15px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 700;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border var(--transition);
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    background: var(--black);
    color: #fff;
    box-shadow: 0 12px 24px rgba(17, 17, 17, 0.18);
}

.btn-secondary,
.btn-ghost {
    background: rgba(255, 253, 248, 0.82);
    border-color: var(--line);
    color: var(--ink);
}

.btn-large {
    min-height: 44px;
    padding-inline: 20px;
}

.btn-full {
    width: 100%;
    min-height: 54px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.72fr) minmax(500px, 1.28fr);
    align-items: center;
    gap: 46px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--brown);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 540px;
    margin-bottom: 14px;
    font-size: 26px;
    line-height: 1.16;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 10px;
    font-size: 18px;
    line-height: 1.18;
    letter-spacing: 0;
}

h3 {
    margin-bottom: 7px;
    font-size: 15px;
    line-height: 1.25;
}

p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.hero-subtitle {
    max-width: 500px;
    font-size: 13px;
    line-height: 1.62;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 26px 0 22px;
}

.trust-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 13px;
}

.trust-row span {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.65);
}

.hero-showcase {
    position: relative;
    min-height: 620px;
}

.polaroid-card,
.floating-card,
.workspace-card,
.sticky-preview,
.pricing-card,
.template-card,
.steps-grid article,
.why-list article,
.faq-list details {
    background: rgba(255, 253, 248, 0.92);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}

.main-sample {
    --card-rotation: 1.5deg;
    position: absolute;
    top: 2px;
    right: 58px;
    z-index: 2;
    width: min(420px, 61%);
    padding: 14px 14px 18px;
    border-radius: 24px;
    transform: rotate(var(--card-rotation));
}

.hero-showcase .showcase-card,
.hero-showcase .sample-card {
    transform-origin: 50% 58%;
    will-change: transform;
    transition: opacity 220ms ease, box-shadow var(--transition), filter var(--transition);
}

.hero-showcase.hero-loading .showcase-card,
.hero-showcase.hero-loading .sample-card,
.hero-showcase.hero-loading .preview-widget {
    opacity: 0;
}

.hero-showcase:not(.hero-loading) .showcase-card,
.hero-showcase:not(.hero-loading) .sample-card,
.hero-showcase:not(.hero-loading) .preview-widget {
    opacity: 1;
}

.hero-showcase .showcase-card:hover,
.hero-showcase .sample-card:hover {
    z-index: 5;
    animation: hero-card-wobble 920ms ease-in-out infinite;
    box-shadow: 0 28px 70px rgba(24, 35, 66, 0.16);
    filter: saturate(1.03);
}

.sample-image {
    min-height: 220px;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f8f9fb;
    overflow: hidden;
}

.portrait-card .sample-image {
    aspect-ratio: 3 / 4;
    min-height: 0;
}

.sample-pet {
    background-image:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.12)),
        var(--visual-pet);
    background-position: 52% 44%;
}

.sample-child {
    background-image:
        linear-gradient(135deg, rgba(255, 253, 248, 0.10), rgba(184, 132, 94, 0.10)),
        var(--visual-child);
    background-position: 50% 38%;
}

.sample-product {
    background-image:
        linear-gradient(135deg, rgba(255, 253, 248, 0.06), rgba(111, 133, 110, 0.12)),
        var(--visual-product);
    background-position: 50% 45%;
}

.sample-avatar {
    background-image:
        linear-gradient(135deg, rgba(255, 253, 248, 0.10), rgba(184, 132, 94, 0.08)),
        var(--visual-avatar);
    background-position: 50% 44%;
}

.sample-poster {
    background-image:
        linear-gradient(135deg, rgba(251, 250, 247, 0.04), rgba(184, 132, 94, 0.10)),
        var(--visual-poster);
    background-position: 50% 34%;
}

.sample-video {
    background-image:
        linear-gradient(135deg, rgba(17, 17, 17, 0.08), rgba(111, 133, 110, 0.12)),
        var(--visual-video);
    background-position: 50% 36%;
}

.polaroid-caption {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    font-size: 14px;
    font-weight: 800;
}

.polaroid-caption small {
    color: var(--muted);
    font-weight: 600;
}

.floating-card {
    position: absolute;
    padding: 12px;
    border-radius: 20px;
}

.floating-card .sample-image {
    min-height: 0;
}

.floating-card span {
    display: block;
    padding-top: 8px;
    font-size: 13px;
    font-weight: 800;
}

.child-card {
    --card-rotation: -4deg;
    left: 122px;
    top: 230px;
    z-index: 1;
    width: 248px;
    transform: rotate(var(--card-rotation));
}

.product-card {
    --card-rotation: 3deg;
    right: 16px;
    bottom: 6px;
    z-index: 3;
    width: 252px;
    transform: rotate(var(--card-rotation));
}

@keyframes hero-card-wobble {
    0%,
    100% {
        transform: translate3d(0, -5px, 0) rotate(var(--card-rotation));
    }
    25% {
        transform: translate3d(0, -7px, 0) rotate(calc(var(--card-rotation) + 1deg));
    }
    50% {
        transform: translate3d(0, -5px, 0) rotate(calc(var(--card-rotation) - 0.8deg));
    }
    75% {
        transform: translate3d(0, -6px, 0) rotate(calc(var(--card-rotation) + 0.5deg));
    }
}

.preview-widget {
    position: absolute;
    left: 112px;
    top: 88px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.94);
    box-shadow: var(--shadow-soft);
    font-size: 13px;
    font-weight: 700;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--sage);
}

.section-heading {
    margin-bottom: 24px;
}

.split-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
}

.centered {
    text-align: center;
    max-width: 760px;
    margin-inline: auto;
}

.text-link {
    font-size: 14px;
    color: var(--ink);
    font-weight: 800;
    border-bottom: 1px solid var(--ink);
}

.category-row,
.tabs,
.mode-tabs,
.quantity-row,
.credit-packs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.pricing-contact-showcase {
    border: 1px solid var(--line);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 255, 0.92)),
        var(--paper);
    box-shadow: 0 12px 36px rgba(40, 54, 86, 0.06);
    overflow: hidden;
}

.pricing-contact-showcase {
    margin-top: 18px;
    padding: 0;
}

.pricing-contact-showcase img {
    display: block;
    width: 100%;
    height: auto;
}

.chip,
.tab,
.mode-tab,
.quantity,
.credit-packs button {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.86);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.chip.active,
.tab.active,
.mode-tab.active,
.quantity.active {
    background: var(--black);
    border-color: var(--black);
    color: #fff;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.template-card {
    overflow: hidden;
    border-radius: 18px;
    transition: transform var(--transition), box-shadow var(--transition);
}

.template-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.template-cover {
    height: 330px;
    width: 100%;
    border: 0;
    display: block;
    cursor: pointer;
    background-image: var(--cover);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: #f8f9fb;
}

button.template-cover:focus-visible {
    outline: 3px solid rgba(123, 97, 255, 0.26);
    outline-offset: -3px;
}

.template-body {
    padding: 10px 13px 12px;
}

.template-body h3 {
    margin-bottom: 4px;
    font-size: 14px;
}

.template-body p {
    display: none;
}

.template-card .card-meta {
    align-items: center;
    margin: 6px 0;
    font-size: 12px;
}

.template-card .card-action {
    min-height: 24px;
    font-size: 13px;
}

.tag {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 7px;
    margin-bottom: 6px;
    color: #5f4d8f;
    background: rgba(184, 164, 255, 0.18);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.tag.sage {
    color: var(--sage);
    background: rgba(111, 133, 110, 0.14);
}

.tag.brown {
    color: #8a5e3d;
    background: rgba(184, 132, 94, 0.16);
}

.card-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
    margin: 10px 0;
}

.card-meta strong {
    color: var(--ink);
}

.card-action {
    display: inline-flex;
    border: 0;
    padding: 0;
    background: transparent;
    font-weight: 800;
    color: var(--ink);
    font-size: 13px;
}

.awesome-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.awesome-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: -6px 0 18px;
}

.awesome-stats span {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.86);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.awesome-stats strong {
    margin-right: 4px;
    color: var(--ink);
}

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

.awesome-template-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 253, 248, 0.92);
    box-shadow: var(--shadow-soft);
    transition: transform var(--transition), box-shadow var(--transition);
}

.awesome-template-card:hover,
.awesome-template-card.active {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.awesome-template-card.active {
    border-color: var(--ink);
}

.awesome-template-cover {
    display: block;
    width: 100%;
    min-height: 300px;
    border: 0;
    padding: 0;
    background: var(--paper-deep);
    overflow: hidden;
}

.awesome-template-cover img,
.awesome-template-cover video {
    display: block;
    width: 100%;
    height: 300px;
    object-fit: contain;
    object-position: center;
    transition: transform var(--transition);
}

.awesome-template-cover-placeholder {
    width: 100%;
    min-height: 300px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    padding: 20px;
    background:
        linear-gradient(180deg, rgba(244, 247, 252, 0.96), rgba(232, 237, 245, 0.96));
    color: var(--muted);
    text-align: center;
}

.awesome-template-cover-placeholder strong {
    color: var(--ink);
    font-size: 18px;
    line-height: 1.35;
}

.awesome-template-cover-placeholder small {
    font-size: 12px;
    font-weight: 800;
}

.awesome-template-card:hover .awesome-template-cover img,
.awesome-template-card:hover .awesome-template-cover video {
    transform: scale(1.035);
}

.awesome-template-card div {
    padding: 10px 13px 12px;
}

.awesome-template-card span {
    display: inline-flex;
    max-width: 100%;
    margin-bottom: 6px;
    color: var(--brown);
    font-size: 11px;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.awesome-template-card h3 {
    display: -webkit-box;
    margin-bottom: 5px;
    font-size: 14px;
    min-height: auto;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.awesome-template-card p {
    display: none;
}

.awesome-template-card small {
    display: block;
    color: var(--soft);
    font-size: 11px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.loading-card {
    opacity: 0.72;
}

.loading-card .awesome-template-cover {
    background:
        linear-gradient(90deg, rgba(231, 235, 242, 0.9), rgba(247, 249, 252, 0.9), rgba(231, 235, 242, 0.9));
}

.awesome-more-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.template-library-page {
    padding-top: 104px;
}

.library-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
    margin-bottom: 18px;
}

.library-header h1 {
    max-width: 650px;
    margin-bottom: 8px;
}

.library-controls {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(180px, 0.38fr) minmax(130px, 0.2fr);
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 253, 248, 0.92);
    box-shadow: var(--shadow-soft);
}

.library-controls label {
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
}

.library-controls input,
.library-controls select {
    min-height: 36px;
    font-size: 13px;
}

.library-status,
.library-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 14px 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.library-pagination {
    justify-content: center;
}

.library-page-indicator {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 253, 248, 0.92);
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.template-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.16fr) minmax(360px, 0.84fr);
    gap: 20px;
    align-items: start;
}

.template-result-panel,
.generation-config,
.param-panel,
.prompt-panel {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 253, 248, 0.92);
    box-shadow: var(--shadow-soft);
}

.template-result-panel {
    overflow: hidden;
}

.template-result-image {
    min-height: clamp(440px, 58vh, 720px);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.18)),
        var(--cover, none);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f8f9fb;
}

.template-result-image {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.template-result-body {
    padding: 12px 14px 14px;
}

.template-result-body span,
.prompt-panel-header span,
.param-header span {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--brown);
    font-size: 11px;
    font-weight: 900;
}

.prompt-panel-header strong,
.param-header strong {
    display: block;
    color: var(--ink);
    font-weight: 900;
}

.template-result-body p {
    margin: 7px 0 0;
    font-size: 12px;
    line-height: 1.55;
}

.template-editor-main {
    display: grid;
    gap: 18px;
}

.template-showcase-panel {
    padding: 16px;
}

.generation-config,
.param-panel,
.prompt-panel {
    padding: 14px;
}

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

.generation-config {
    padding: 12px;
}

.generation-config .param-header {
    margin-bottom: 9px;
}

.generation-config .param-header strong {
    font-size: 14px;
}

.generation-config label {
    gap: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.generation-config input,
.generation-config select {
    min-height: 34px;
    padding: 0 9px;
    border-radius: 10px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
}

.config-tip {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(17, 17, 17, 0.06);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.template-reference-uploader {
    margin-top: 12px;
}

.template-reference-drop {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    padding: 10px 12px;
    border: 1.5px dashed var(--line-strong);
    border-radius: 12px;
    background: rgba(247, 244, 238, 0.65);
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: border var(--transition), background var(--transition), transform var(--transition);
}

.template-reference-drop.has-images {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
}

.template-reference-drop-main {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.template-reference-drop:hover,
.template-reference-drop.dragover,
.template-reference-drop:focus-visible {
    border-color: var(--brown);
    background: rgba(184, 132, 94, 0.08);
    outline: none;
}

.template-reference-drop:active {
    transform: translateY(1px);
}

.template-reference-drop span {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.template-reference-drop strong {
    display: block;
    color: var(--ink);
    font-size: 18px;
    font-weight: 950;
    line-height: 1.1;
}

.template-reference-drop em {
    flex: 0 0 auto;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    background: #fff;
    font-size: 13px;
    font-style: normal;
    font-weight: 900;
    box-shadow: var(--shadow-soft);
}

.template-reference-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
    gap: 8px;
    margin-top: 0;
}

.template-reference-drop .template-reference-preview {
    width: 100%;
    margin-top: 0;
    grid-template-columns: repeat(auto-fill, minmax(72px, 72px));
}

.template-reference-empty {
    grid-column: 1 / -1;
    padding: 2px 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.template-reference-thumb {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 10px;
    background: #eef0f4;
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: 0 10px 20px rgba(24, 35, 66, 0.08);
}

.template-reference-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.template-reference-thumb button {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: rgba(0, 0, 0, 0.72);
    font-size: 15px;
    font-weight: 900;
    line-height: 20px;
}

.template-reference-inline-empty {
    display: none;
}

.credit-estimate {
    display: grid;
    grid-template-columns: minmax(150px, 0.9fr) minmax(0, 1.7fr);
    gap: 12px;
    align-items: center;
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    background: #111;
    color: #fff;
}

.credit-estimate div {
    min-width: 0;
}

.credit-estimate span {
    display: block;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 11px;
    font-weight: 900;
}

.credit-estimate strong {
    display: block;
    color: #fff;
    font-size: 20px;
    font-weight: 950;
    line-height: 1.1;
}

.credit-estimate p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    line-height: 1.55;
}

.param-empty {
    padding: 8px 0;
}

.param-empty strong {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
}

.param-empty p {
    margin: 0;
    font-size: 12px;
}

.param-header,
.prompt-panel-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: start;
    margin-bottom: 12px;
}

.param-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.param-field {
    min-width: 0;
}

.param-field-wide {
    grid-column: 1 / -1;
}

.param-field span {
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.param-field input,
.param-field textarea {
    background: #fff;
}

.param-choice-field {
    align-content: start;
}

.param-choice-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.param-choice-group button {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    color: var(--ink);
    font-size: 12px;
    font-weight: 900;
    transition: background var(--transition), border var(--transition), color var(--transition), transform var(--transition);
}

.param-choice-group button:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
}

.param-choice-group button.active {
    border-color: var(--black);
    background: var(--black);
    color: #fff;
}

.prompt-actions,
.editor-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.prompt-compose-grid {
    display: grid;
    grid-template-columns: minmax(320px, 0.54fr) minmax(0, 0.46fr);
    gap: 14px;
    align-items: stretch;
}

.prompt-template-preview {
    min-width: 0;
    display: grid;
    grid-template-rows: minmax(220px, 1fr) auto;
    gap: 10px;
}

.prompt-template-preview-large {
    grid-template-rows: minmax(420px, 1fr) auto;
}

.prompt-template-image {
    min-height: 260px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(17, 17, 17, 0.05)),
        var(--cover, none);
    background-color: #f8f9fb;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    overflow: hidden;
}

.prompt-template-preview-large .prompt-template-image {
    min-height: clamp(420px, 62vh, 760px);
    background-size: contain;
    background-position: top center;
}

.prompt-template-image span {
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    box-shadow: var(--shadow-soft);
}

.prompt-template-image[style*="--cover"] span {
    display: none;
}

.prompt-template-preview strong,
.prompt-template-preview small,
.prompt-user-guide span,
.prompt-editor-field span {
    display: block;
}

.prompt-template-preview strong {
    color: var(--ink);
    font-size: 15px;
    line-height: 1.35;
}

.prompt-template-preview small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.prompt-user-guide {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    display: grid;
    align-content: start;
    gap: 12px;
}

.prompt-guide-stack {
    min-width: 0;
    display: grid;
    grid-template-rows: auto minmax(190px, 1fr);
    gap: 12px;
}

.prompt-user-guide span {
    color: var(--brown);
    font-size: 11px;
    font-weight: 900;
}

.prompt-user-guide strong {
    color: var(--ink);
    font-size: clamp(18px, 2vw, 24px);
    line-height: 1.25;
}

.prompt-user-guide p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.75;
}

.prompt-guide-section {
    display: grid;
    gap: 8px;
}

.prompt-guide-section b {
    color: var(--ink);
    font-size: 13px;
}

.prompt-guide-tags,
.prompt-guide-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.prompt-guide-tags em,
.prompt-guide-list em {
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(247, 244, 238, 0.74);
    color: var(--ink);
    font-size: 12px;
    font-style: normal;
    font-weight: 850;
    line-height: 1;
}

.prompt-guide-list em {
    border-radius: 10px;
    background: rgba(125, 91, 63, 0.08);
}

.prompt-user-edit-field {
    min-width: 0;
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.prompt-user-edit-field span {
    color: var(--brown);
    font-size: 11px;
    font-weight: 900;
}

.prompt-user-edit-field textarea {
    width: 100%;
    min-height: 170px;
    resize: vertical;
    background: rgba(255, 253, 248, 0.86);
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.7;
}

.prompt-user-edit-field small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.5;
}

.prompt-raw-details {
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    overflow: hidden;
}

.prompt-raw-details summary {
    cursor: pointer;
    padding: 12px 14px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 950;
}

.prompt-raw-details .prompt-editor-field {
    padding: 0 14px 14px;
}

.prompt-editor-field {
    min-width: 0;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 8px;
}

.prompt-editor-field span {
    color: var(--brown);
    font-size: 11px;
    font-weight: 900;
}

#templatePromptEditor {
    min-height: 420px;
    height: 100%;
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: 12px;
    line-height: 1.7;
    background: #fff;
}

.generation-config {
    order: 2;
}

.param-panel {
    order: 3;
}

.template-editor .section-heading {
    margin-bottom: 16px;
}

.template-editor .section-heading h2 {
    font-size: 18px;
}

.template-editor .section-heading p {
    max-width: 760px;
    font-size: 13px;
    line-height: 1.55;
}

.template-result-image {
    position: relative;
}

.template-result-image span {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.84);
    font-size: 13px;
    font-weight: 900;
    box-shadow: var(--shadow-soft);
}

.template-result-image.has-result span {
    display: none;
}

.template-result-image.generating span {
    color: #39465f;
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(117, 132, 166, 0.28);
}

.template-result-image.generating span::before {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid rgba(108, 93, 211, 0.22);
    border-top-color: var(--brown);
    border-right-color: var(--brown);
    border-radius: 999px;
    animation: result-spin 0.78s linear infinite;
}

.template-result-image.result-error span {
    color: #9f2f3a;
    background: rgba(255, 246, 246, 0.94);
    border-color: rgba(210, 76, 93, 0.22);
}

.template-result-image.generating::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent),
        rgba(255, 255, 255, 0.10);
    animation: shimmer 1.1s linear infinite;
    pointer-events: none;
}

.template-result-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 12px;
}

.template-result-actions .btn {
    width: 100%;
}

.template-result-body small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

@keyframes shimmer {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(100%);
    }
}

@keyframes result-spin {
    to {
        transform: rotate(360deg);
    }
}

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

.steps-grid article {
    padding: 20px;
    border-radius: 16px;
}

.step-index {
    display: inline-block;
    margin-bottom: 18px;
    color: var(--brown);
    font-size: 12px;
    font-weight: 900;
}

.steps-grid h3,
.why-list h3,
.pricing-card h3,
.faq-list summary {
    font-size: 15px;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.84fr) minmax(420px, 1fr);
    gap: 48px;
    align-items: start;
}

.detail-intro {
    font-size: 15px;
}

.template-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 24px 0;
}

.template-stats span {
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.8);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.creation-form {
    display: grid;
    gap: 18px;
}

fieldset {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    margin: 0;
    background: rgba(255, 253, 248, 0.78);
}

legend {
    padding: 0 8px;
    font-weight: 900;
}

label {
    display: grid;
    gap: 6px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.95);
    border-radius: 12px;
    color: var(--ink);
    outline: none;
    transition: border var(--transition), box-shadow var(--transition);
}

input,
select {
    min-height: 40px;
    padding: 0 11px;
    font-size: 13px;
}

textarea {
    min-height: 96px;
    resize: vertical;
    padding: 11px;
    font-size: 13px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brown);
    box-shadow: 0 0 0 4px rgba(184, 132, 94, 0.12);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.upload-area {
    min-height: 160px;
    display: grid;
    place-items: center;
    border: 1.5px dashed var(--line-strong);
    border-radius: 18px;
    background: rgba(247, 244, 238, 0.65);
    text-align: center;
    transition: border var(--transition), background var(--transition);
}

.upload-area.dragover {
    border-color: var(--brown);
    background: rgba(184, 132, 94, 0.08);
}

.upload-area img {
    max-height: 220px;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
}

.upload-placeholder {
    padding: 22px;
}

.upload-placeholder p {
    margin-bottom: 0;
    font-size: 14px;
}

.icon-upload {
    display: inline-block;
    width: 42px;
    height: 42px;
    margin-bottom: 12px;
    border: 1.5px solid var(--line-strong);
    border-radius: 14px;
    background:
        linear-gradient(var(--ink), var(--ink)) center 14px / 2px 14px no-repeat,
        linear-gradient(45deg, transparent 43%, var(--ink) 44% 56%, transparent 57%) center 11px / 13px 13px no-repeat;
}

.quality-check {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.quality-check span {
    color: var(--muted);
    font-size: 12px;
    padding: 6px 9px;
    background: var(--bg-warm);
    border-radius: 999px;
}

.swatch-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.swatch {
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    color: var(--ink);
    font-weight: 800;
}

.swatch::before {
    content: "";
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--swatch);
    vertical-align: -1px;
}

.swatch.active {
    border-color: var(--ink);
}

.detail-preview {
    min-width: 0;
}

.sticky-preview {
    position: sticky;
    top: 94px;
    padding: 20px;
    border-radius: 26px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
    margin-bottom: 16px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background:
        linear-gradient(var(--ink), var(--ink)) center / 15px 1.5px no-repeat,
        var(--paper);
}

.result-container {
    min-height: 470px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--bg-warm);
    overflow: hidden;
}

.preview-polaroid {
    width: min(360px, 82%);
    padding: 18px 18px 38px;
    border-radius: 22px;
    background: #fffefa;
    box-shadow: var(--shadow);
    transform: rotate(-1deg);
}

.preview-polaroid .sample-image {
    min-height: 340px;
}

.preview-polaroid p {
    margin: 12px 8px 0;
    color: var(--ink);
    font-size: 16px;
    font-weight: 800;
    font-family: "Noto Serif SC", "Source Han Serif SC", serif;
    text-align: right;
}

.result-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.btn-action {
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    color: var(--ink);
    font-weight: 800;
}

.history-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.history-item {
    min-height: 76px;
    border: 2px solid transparent;
    border-radius: 14px;
    background-size: cover;
    background-position: center;
}

.history-item.active {
    border-color: var(--brown);
}

.custom-image-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
    gap: 24px;
    align-items: start;
}

.custom-image-panel,
.custom-output-panel {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-soft);
}

.custom-image-panel {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.custom-output-panel {
    position: sticky;
    top: 92px;
    overflow: hidden;
}

.custom-panel-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.custom-output-panel .custom-panel-header {
    padding: 16px 16px 0;
}

.custom-panel-header span {
    display: block;
    margin-bottom: 4px;
    color: var(--brown);
    font-size: 11px;
    font-weight: 900;
}

.custom-panel-header strong {
    display: block;
    color: var(--ink);
    font-size: 18px;
    font-weight: 950;
    line-height: 1.2;
}

.custom-panel-header em {
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f8f9fb;
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
}

.custom-prompt-field textarea {
    min-height: 180px;
    border-radius: 14px;
    background: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.7;
}

.custom-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.custom-form-grid label,
.custom-prompt-field {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.custom-form-grid input,
.custom-form-grid select {
    min-height: 42px;
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
}

.custom-reference-block {
    min-width: 0;
}

.advanced-panel {
    display: none;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.advanced-panel.open {
    display: block;
}

.custom-advanced-panel {
    margin-top: 0;
    padding-top: 14px;
}

.custom-credit-estimate {
    margin-top: 0;
}

.custom-image-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.custom-image-actions .btn {
    min-height: 46px;
}

.custom-output-preview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: clamp(420px, 56vh, 700px);
    margin: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.12)),
        var(--cover, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f8f9fb;
    overflow: hidden;
}

.custom-output-preview.has-result {
    background-size: contain;
}

.custom-output-preview span {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.88);
    font-size: 13px;
    font-weight: 900;
    box-shadow: var(--shadow-soft);
}

.custom-output-preview.has-result span {
    display: none;
}

.custom-output-preview.generating span {
    color: #39465f;
    background: rgba(255, 255, 255, 0.94);
}

.custom-output-preview.generating span::before {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid rgba(108, 93, 211, 0.22);
    border-top-color: var(--brown);
    border-right-color: var(--brown);
    border-radius: 999px;
    animation: result-spin 0.78s linear infinite;
}

.custom-output-preview.result-error span {
    color: #9f2f3a;
    background: rgba(255, 246, 246, 0.94);
    border-color: rgba(210, 76, 93, 0.22);
}

.custom-output-preview.generating::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent),
        rgba(255, 255, 255, 0.12);
    animation: shimmer 1.1s linear infinite;
    pointer-events: none;
}

.custom-result-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px;
    padding: 0 16px 12px;
}

.custom-result-gallery button {
    aspect-ratio: 1;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    background: #eef0f4;
    overflow: hidden;
}

.custom-result-gallery button.active {
    border-color: var(--brown);
}

.custom-result-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.custom-result-actions {
    padding: 0 16px 12px;
    margin-top: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.custom-result-summary {
    margin: 0;
    padding: 0 16px 16px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.6;
}

.video-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
    gap: 28px;
    align-items: start;
}

.video-controls-panel,
.video-result-panel {
    min-width: 0;
}

.video-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.video-options label,
.video-prompt-field {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.video-options select,
.video-prompt-field textarea {
    width: 100%;
    margin-top: 6px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    font-weight: 750;
}

.video-options select {
    min-height: 38px;
    padding: 0 10px;
}

.video-prompt-field textarea {
    min-height: 118px;
    padding: 10px 11px;
    resize: vertical;
    line-height: 1.55;
}

.video-upload {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding: 11px 12px;
    border: 1.5px dashed var(--line-strong);
    border-radius: 12px;
    background: #f8f9fb;
    cursor: pointer;
    transition: border var(--transition), background var(--transition), transform var(--transition);
}

.video-upload:hover,
.video-upload.dragover,
.video-upload:focus-visible {
    border-color: var(--brown);
    background: rgba(123, 97, 255, 0.06);
    outline: none;
}

.video-upload:active {
    transform: translateY(1px);
}

.video-upload span,
.video-upload small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.video-upload strong {
    display: block;
    margin: 2px 0;
    color: var(--ink);
    font-size: 16px;
    font-weight: 950;
}

.video-upload em {
    flex: 0 0 auto;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
}

.video-reference-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
    gap: 8px;
    margin-top: 9px;
}

.video-reference-preview > span {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.video-cost-row {
    display: grid;
    grid-template-columns: minmax(92px, 0.45fr) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    margin: 12px 0;
    padding: 11px 12px;
    border-radius: 12px;
    background: #111;
    color: #fff;
}

.video-cost-row strong {
    font-size: 18px;
    font-weight: 950;
}

.video-cost-row span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    line-height: 1.45;
}

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

.video-template-card {
    min-width: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: inherit;
    text-align: left;
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition), border var(--transition), box-shadow var(--transition);
}

.video-template-card:hover,
.video-template-card.active {
    transform: translateY(-2px);
    border-color: var(--ink);
    box-shadow: var(--shadow-soft);
}

.video-template-card img,
.video-template-card video {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #111;
}

.video-template-card span,
.video-template-card small {
    display: block;
    padding: 0 9px;
}

.video-template-card span {
    margin-top: 8px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-template-card small {
    margin: 3px 0 9px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}

.video-template-empty {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.video-more-link {
    display: inline-flex;
    margin-top: 12px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
    border-bottom: 1px solid var(--ink);
}

.video-preview {
    position: relative;
    min-height: 430px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.video-preview > span {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
    box-shadow: var(--shadow-soft);
}

.video-preview.is-loading > span::before {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid rgba(123, 97, 255, 0.2);
    border-top-color: var(--brown);
    border-right-color: var(--brown);
    border-radius: 999px;
    animation: result-spin 0.78s linear infinite;
}

.video-preview.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.32), transparent),
        rgba(255, 255, 255, 0.08);
    animation: shimmer 1.1s linear infinite;
}

.video-preview.is-error > span {
    color: #9f2f3a;
    background: rgba(255, 246, 246, 0.94);
    border-color: rgba(210, 76, 93, 0.22);
}

.video-preview video {
    width: 100%;
    height: 100%;
    min-height: 430px;
    object-fit: cover;
    display: block;
    background: #111;
}

.video-result-meta {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.video-result-meta strong {
    font-size: 16px;
}

.video-result-meta p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.video-result-meta .btn {
    width: max-content;
}

.btn.disabled {
    pointer-events: none;
    opacity: 0.48;
}

.hidden {
    display: none !important;
}

.play-button {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background:
        linear-gradient(90deg, var(--black) 0 0) 55% center / 16px 22px no-repeat,
        rgba(255, 253, 248, 0.86);
    clip-path: none;
    box-shadow: var(--shadow);
}

.play-button::after {
    content: "";
    display: block;
    width: 0;
    height: 0;
    margin: 27px 0 0 32px;
    border-left: 18px solid var(--ink);
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
}

.masonry {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 160px;
    gap: 14px;
}

.work-card {
    position: relative;
    display: block;
    border-radius: 20px;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    text-decoration: none;
}

.work-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.48), transparent 55%);
}

.work-card span {
    position: absolute;
    left: 14px;
    bottom: 12px;
    z-index: 1;
    color: #fff;
    font-weight: 800;
}

.work-card small {
    position: absolute;
    left: 14px;
    bottom: 34px;
    z-index: 1;
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
    font-weight: 700;
}

.dynamic-work-card {
    background-color: #eef2f7;
}

.dynamic-work-card:hover {
    transform: translateY(-2px);
}

.works-account-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
    color: var(--ink);
    font-weight: 800;
}

.work-card.tall {
    grid-row: span 2;
}

.work-card.wide {
    grid-column: span 2;
}

.why-grid,
.faq-grid,
.footer-grid {
    display: grid;
    grid-template-columns: 0.7fr 1fr;
    gap: 48px;
}

.why-list {
    display: grid;
    gap: 14px;
}

.why-list article {
    padding: 24px;
    border-radius: 20px;
}

.pricing-toggle {
    justify-content: center;
    margin-bottom: 24px;
    color: var(--muted);
    font-weight: 800;
}

.switch {
    position: relative;
    width: 58px;
    height: 32px;
    display: inline-block;
}

.switch input {
    display: none;
}

.slider {
    position: absolute;
    inset: 0;
    background: var(--paper-deep);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.slider::before {
    content: "";
    position: absolute;
    width: 24px;
    height: 24px;
    top: 3px;
    left: 4px;
    border-radius: 50%;
    background: var(--black);
    transition: transform var(--transition);
}

.switch input:checked + .slider::before {
    transform: translateX(25px);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

.pricing-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-radius: 18px;
}

.pricing-card.featured {
    border-color: var(--black);
    box-shadow: var(--shadow);
}

.featured-badge {
    position: absolute;
    top: 18px;
    right: 18px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--black);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}

.price {
    display: flex;
    align-items: end;
    gap: 4px;
    margin: 14px 0 8px;
}

.amount {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: 0;
}

.pricing-card ul {
    flex: 1;
    padding-left: 18px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.btn-pricing {
    width: 100%;
    min-height: 44px;
    margin-top: auto;
    border: 1px solid var(--black);
    border-radius: 12px;
    background: var(--black);
    color: #fff;
    font-weight: 900;
}

.credit-packs {
    margin-top: 22px;
    justify-content: center;
}

.credit-packs span {
    font-weight: 900;
}

.faq-list {
    display: grid;
    gap: 12px;
}

.faq-list details {
    padding: 20px 22px;
    border-radius: 18px;
}

.faq-list summary {
    font-weight: 900;
    cursor: pointer;
}

.faq-list p {
    margin: 12px 0 0;
}

.footer {
    padding: 54px 0;
    border-top: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(242, 238, 231, 0.98), rgba(244, 241, 236, 0.98)),
        #f2eee7;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: "";
    position: absolute;
    right: -140px;
    bottom: -90px;
    width: min(620px, 44vw);
    aspect-ratio: 2508 / 627;
    background: url("assets/yc-ai-lab-contact-card.png") center/cover no-repeat;
    opacity: 0.045;
    pointer-events: none;
    filter: grayscale(0.12) saturate(0.82);
}

.footer-links {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: start;
}

.footer-links a,
.footer-links button {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-weight: 800;
}

.footer-links a:hover,
.footer-links button:hover {
    color: var(--ink);
}

.auth-hint a {
    color: var(--brown);
    font-weight: 800;
}

.toast-container {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1200;
    display: grid;
    gap: 10px;
}

.toast {
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--paper);
    box-shadow: var(--shadow-soft);
    font-weight: 800;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(21, 21, 21, 0.36);
    z-index: 1100;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: min(520px, 100%);
    max-height: calc(100dvh - 44px);
    overflow: auto;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: var(--paper);
    box-shadow: var(--shadow);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-bottom: 18px;
}

.modal-header h3 {
    margin: 0;
}

.btn-close {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-warm);
    font-size: 18px;
}

.payment-plan {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-radius: 16px;
    background: var(--bg-warm);
    font-weight: 900;
}

.payment-plan strong {
    font-size: 18px;
}

.payment-quote-note {
    margin: 10px 2px 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
}

.payment-method {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    font-weight: 900;
}

.payment-method.active {
    border-color: var(--black);
    background: var(--black);
    color: #fff;
}

.qrcode-container {
    display: grid;
    place-items: center;
    gap: 12px;
    min-height: 190px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--bg-warm);
    text-align: center;
}

.qrcode-placeholder {
    width: 118px;
    height: 118px;
    display: grid;
    place-items: center;
    border: 1px dashed var(--line-strong);
    border-radius: 16px;
    background: var(--paper);
    color: var(--muted);
    font-weight: 900;
}

.qrcode-image-wrap {
    width: min(100%, 260px);
    min-height: 168px;
    padding: 12px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: var(--paper);
    box-shadow: var(--shadow-soft);
}

.qrcode-image {
    width: 100%;
    max-width: 236px;
    max-height: 320px;
    height: auto;
    object-fit: contain;
    display: block;
}

.qrcode-image-wrap canvas,
.qrcode-image-wrap img {
    max-width: 100%;
    height: auto;
    display: block;
}

.payment-contact {
    margin-top: 14px;
    color: var(--muted);
}

.payment-contact-qr {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.payment-contact-qr img {
    display: block;
    width: min(100%, 160px);
    height: auto;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.account-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.auth-view {
    display: none;
}

.auth-view.active {
    display: block;
}

.auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 6px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--bg-warm);
}

.auth-tabs button {
    min-height: 40px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-weight: 900;
}

.auth-tabs button.active {
    background: var(--paper);
    color: var(--ink);
    box-shadow: var(--shadow-soft);
}

.auth-form {
    display: none;
    gap: 14px;
}

.auth-form.active {
    display: grid;
}

.auth-form label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.auth-form input {
    width: 100%;
    min-height: 46px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    color: var(--ink);
    outline: none;
}

.auth-form input:focus {
    border-color: var(--black);
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08);
}

.auth-code-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 132px;
    gap: 10px;
    align-items: end;
}

.auth-code-row .btn {
    min-height: 46px;
}

.captcha-row {
    display: grid;
    grid-template-columns: auto minmax(90px, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.captcha-row strong {
    min-height: 46px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(248, 247, 242, 0.86);
    color: var(--ink);
    white-space: nowrap;
}

.captcha-row .btn {
    min-height: 46px;
    white-space: nowrap;
}

@media (max-width: 560px) {
    .captcha-row {
        grid-template-columns: 1fr;
    }
}

.auth-hint,
.wechat-login-card p,
.invite-panel p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.wechat-login-card,
.invite-panel,
.account-profile {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--bg-warm);
}

.wechat-login-card strong,
.invite-panel strong,
.account-profile strong {
    display: block;
    margin-top: 4px;
    font-size: 18px;
}

.account-profile {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-bottom: 14px;
}

.account-profile span,
.invite-panel span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.invite-panel {
    margin-top: 14px;
}

.invite-code-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0;
}

.invite-code-row strong {
    font-size: 22px;
    letter-spacing: 0.08em;
}

.account-grid article {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--bg-warm);
}

.account-grid span {
    display: block;
    color: var(--muted);
}

.account-grid strong {
    display: block;
    margin-top: 8px;
    font-size: 17px;
}

.account-actions {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

@media (max-width: 1080px) {
    .nav-links {
        display: none;
    }

    .mobile-menu {
        display: inline-block;
        margin-left: auto;
    }

    .nav-links.open {
        position: absolute;
        top: 72px;
        left: 20px;
        right: 20px;
        display: grid;
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: var(--paper);
        box-shadow: var(--shadow);
    }

    .hero-grid,
    .detail-grid,
    .template-editor-grid,
    .prompt-compose-grid,
    .custom-image-grid,
    .video-grid,
    .why-grid,
    .faq-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .pricing-contact-showcase {
        padding: 0;
    }

    .hero-showcase {
        min-height: 600px;
    }

    .template-grid,
    .awesome-template-grid,
    .config-grid,
    .library-controls,
    .steps-grid,
    .pricing-grid,
    .video-template-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .custom-output-panel {
        position: static;
    }

    .footer-links {
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .container,
    .nav-container {
        width: min(100% - 28px, var(--max));
    }

    .section {
        padding: 56px 0;
    }

    .section-soft {
        padding: 104px 0 58px;
    }

    .nav-actions .btn-ghost {
        display: none;
    }

    .hero-grid {
        gap: 28px;
    }

    h1 {
        font-size: 23px;
    }

    h2 {
        font-size: 17px;
    }

    .hero-subtitle {
        font-size: 14px;
    }

    .hero-showcase {
        min-height: 420px;
    }

    .brand-banner-card,
    .pricing-contact-showcase {
        border-radius: 22px;
    }

    .main-sample {
        right: 0;
        width: 88%;
    }

    .child-card {
        left: 0;
        top: 236px;
        width: 180px;
    }

    .product-card {
        width: 190px;
    }

    .preview-widget {
        left: 10px;
        top: 100px;
        max-width: 250px;
        border-radius: 16px;
    }

    .split-heading {
        display: block;
    }

    .library-header {
        display: block;
    }

    .template-grid,
    .awesome-template-grid,
    .param-grid,
    .config-grid,
    .custom-form-grid,
    .custom-image-actions,
    .custom-result-actions,
    .credit-estimate,
    .library-controls,
    .steps-grid,
    .pricing-grid,
    .form-row,
    .video-options,
    .video-template-grid,
    .video-cost-row,
    .result-grid,
    .masonry,
    .account-grid {
        grid-template-columns: 1fr;
    }

    .account-profile,
    .invite-code-row {
        align-items: stretch;
        flex-direction: column;
    }

    .auth-code-row {
        grid-template-columns: 1fr;
    }

    .video-preview,
    .video-preview video {
        min-height: 340px;
    }

    .swatch-row,
    .result-actions,
    .history-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .custom-output-preview {
        min-height: 340px;
        margin: 12px;
    }

    .result-container {
        min-height: 390px;
    }

    .preview-polaroid .sample-image {
        min-height: 270px;
    }

    .sticky-preview {
        position: static;
    }

    .detail-preview {
        order: -1;
    }

    .work-card.tall,
    .work-card.wide {
        grid-row: auto;
        grid-column: auto;
    }

    .payment-methods {
        grid-template-columns: 1fr;
    }

    .prompt-template-preview-large {
        grid-template-rows: auto auto;
    }

    .prompt-template-preview-large .prompt-template-image {
        min-height: 320px;
    }
}
