.pl3d {
    --pl3d-ink: #17120d;
    --pl3d-muted: #766b5d;
    --pl3d-paper: #fff9ed;
    --pl3d-panel: rgba(255, 250, 240, .95);
    --pl3d-line: rgba(66, 45, 24, .16);
    --pl3d-accent: #c47d35;
    --pl3d-dark: #1e1912;
    background:
        radial-gradient(circle at 10% 5%, rgba(255, 255, 255, .86), transparent 28%),
        radial-gradient(circle at 88% 18%, rgba(214, 149, 76, .26), transparent 30%),
        linear-gradient(150deg, #fffaf0 0%, #eadcc5 46%, #d0a368 100%);
    border-radius: 34px;
    color: var(--pl3d-ink);
    font-family: "Trebuchet MS", Verdana, sans-serif;
    margin: 0 auto;
    max-width: 1500px;
    overflow: hidden;
    padding: clamp(16px, 4vw, 44px);
    position: relative;
}

.pl3d * {
    box-sizing: border-box;
}

.pl3d::before {
    background:
        linear-gradient(rgba(255, 255, 255, .22) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .2) 1px, transparent 1px);
    background-size: 26px 26px;
    content: "";
    inset: 0;
    opacity: .38;
    pointer-events: none;
    position: absolute;
}

.pl3d > * {
    position: relative;
    z-index: 1;
}

.pl3d__hero {
    align-items: flex-end;
    background:
        radial-gradient(circle at 86% 18%, rgba(255, 255, 255, .8), transparent 26%),
        linear-gradient(135deg, rgba(255, 248, 232, .92) 0%, rgba(207, 154, 86, .88) 58%, rgba(59, 38, 24, .94) 100%);
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 30px;
    box-shadow: 0 24px 70px rgba(55, 34, 17, .18);
    display: flex;
    gap: 24px;
    justify-content: space-between;
    margin-bottom: 22px;
    overflow: hidden;
    padding: clamp(24px, 4vw, 42px);
}

.pl3d__eyebrow {
    color: rgba(30, 25, 18, .72);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .16em;
    margin: 0 0 10px;
    text-transform: uppercase;
}

.pl3d h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(34px, 5vw, 70px);
    letter-spacing: -.05em;
    line-height: .92;
    margin: 0;
    max-width: 840px;
}

.pl3d__hero p:last-child {
    color: #322313;
    font-size: 16px;
    line-height: 1.7;
    margin: 18px 0 0;
    max-width: 780px;
}

.pl3d__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    min-width: 260px;
}

.pl3d__button {
    appearance: none;
    background: #fff8e8;
    border: 0;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(30, 25, 18, .12), 0 12px 24px rgba(36, 24, 12, .14);
    color: var(--pl3d-ink);
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: .03em;
    min-height: 48px;
    padding: 14px 20px;
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.pl3d__button--primary {
    background: var(--pl3d-dark);
    color: #fff7e8;
}

.pl3d__button:hover:not(:disabled) {
    box-shadow: inset 0 0 0 1px rgba(30, 25, 18, .16), 0 16px 30px rgba(36, 24, 12, .2);
    transform: translateY(-1px);
}

.pl3d__button:disabled {
    cursor: not-allowed;
    opacity: .52;
}

.pl3d__button[hidden] {
    display: none !important;
}

.pl3d__psLayout {
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
}

.pl3d__panel,
.pl3d__resultCard {
    backdrop-filter: blur(18px);
    background: var(--pl3d-panel);
    border: 1px solid rgba(255, 255, 255, .58);
    box-shadow: 0 20px 60px rgba(64, 43, 20, .12);
}

.pl3d__panel {
    border-radius: 28px;
    padding: 18px;
}

.pl3d__group {
    border-bottom: 1px solid var(--pl3d-line);
    display: grid;
    gap: 12px;
    padding: 18px 0;
}

.pl3d__group:first-child {
    padding-top: 0;
}

.pl3d__group:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.pl3d h2 {
    color: #2d2115;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: .09em;
    margin: 0;
    text-transform: uppercase;
}

.pl3d label {
    color: var(--pl3d-muted);
    display: grid;
    font-size: 12px;
    font-weight: 900;
    gap: 7px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.pl3d input {
    background: #fffbf1;
    border: 1px solid rgba(61, 42, 20, .2);
    border-radius: 14px;
    color: var(--pl3d-ink);
    font: 800 14px/1.25 "Trebuchet MS", Verdana, sans-serif;
    min-height: 44px;
    padding: 10px 12px;
    width: 100%;
}

.pl3d input:focus {
    border-color: rgba(196, 125, 53, .8);
    box-shadow: 0 0 0 4px rgba(196, 125, 53, .14);
    outline: 0;
}

.pl3d input[type="file"] {
    cursor: pointer;
    font-size: 12px;
}

.pl3d__visuallyHidden {
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.pl3d__hint,
.pl3d__templateBadge {
    background: rgba(197, 143, 77, .1);
    border: 1px solid rgba(197, 143, 77, .2);
    border-radius: 14px;
    color: #6c5339;
    font-size: 12px;
    line-height: 1.58;
    margin: 0;
    padding: 12px;
}

.pl3d__hint.is-error {
    background: rgba(180, 48, 36, .1);
    border-color: rgba(180, 48, 36, .25);
    color: #8b2c22;
}

.pl3d__hint.is-success {
    background: rgba(44, 122, 72, .12);
    border-color: rgba(44, 122, 72, .24);
    color: #2f6b43;
}

.pl3d__templateBadge {
    background: rgba(44, 122, 72, .12);
    border-color: rgba(44, 122, 72, .24);
    color: #2f6b43;
    display: grid;
    gap: 5px;
}

.pl3d__templateBadge strong {
    color: #245935;
    font-size: 13px;
}

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

.pl3d__resultCard {
    align-items: center;
    background:
        radial-gradient(circle at 50% 12%, rgba(255, 255, 255, .92), transparent 28%),
        linear-gradient(160deg, rgba(255, 250, 240, .96), rgba(231, 211, 181, .94) 62%, rgba(125, 83, 43, .42));
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 620px;
    overflow: hidden;
    padding: clamp(24px, 4vw, 42px);
    position: relative;
    text-align: center;
}

.pl3d__resultCard::before {
    background:
        radial-gradient(ellipse at center, rgba(60, 35, 14, .2), transparent 66%);
    bottom: 42px;
    content: "";
    height: 80px;
    left: 15%;
    position: absolute;
    right: 15%;
}

.pl3d__previewLabel {
    color: var(--pl3d-accent);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .16em;
    margin: 0 0 10px;
    text-transform: uppercase;
}

.pl3d__resultCard h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(26px, 4vw, 48px);
    letter-spacing: -.04em;
    margin: 0 0 24px;
    text-transform: none;
}

.pl3d__editorShell[hidden],
.pl3d__resultCard > img[data-pl3d-result-image][hidden] {
    display: none !important;
}

.pl3d__editorShell {
    align-items: stretch;
    display: grid;
    gap: 14px;
    max-width: min(94%, 1180px);
    position: relative;
    width: 100%;
    z-index: 1;
}

.pl3d__editorToolbar {
    align-items: center;
    background: rgba(255, 255, 255, .62);
    border: 1px solid rgba(66, 45, 24, .16);
    border-radius: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 14px;
}

.pl3d__toolButton {
    appearance: none;
    background: #fffdf8;
    border: 1px solid rgba(66, 45, 24, .18);
    border-radius: 999px;
    color: #2d2115;
    cursor: pointer;
    font: 800 13px/1 "Trebuchet MS", Verdana, sans-serif;
    min-height: 38px;
    padding: 10px 14px;
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.pl3d__toolButton:hover:not(:disabled) {
    box-shadow: 0 10px 18px rgba(45, 29, 15, .12);
    transform: translateY(-1px);
}

.pl3d__toolButton:disabled {
    cursor: not-allowed;
    opacity: .48;
}

.pl3d__toolButton--danger {
    background: #342116;
    border-color: #342116;
    color: #fff8eb;
}

.pl3d__toolField {
    align-items: center;
    color: #6b5741;
    display: inline-flex;
    font-size: 12px;
    font-weight: 900;
    gap: 8px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.pl3d__toolField select {
    appearance: none;
    background: #fffdf8;
    border: 1px solid rgba(66, 45, 24, .18);
    border-radius: 999px;
    color: #2d2115;
    font: 800 13px/1 "Trebuchet MS", Verdana, sans-serif;
    min-height: 38px;
    min-width: 150px;
    padding: 0 16px;
}

.pl3d__toolField select:focus {
    border-color: rgba(196, 125, 53, .8);
    box-shadow: 0 0 0 4px rgba(196, 125, 53, .14);
    outline: 0;
}

.pl3d__toolField select:disabled {
    cursor: not-allowed;
    opacity: .48;
}

.pl3d__toolField input[type="color"] {
    background: transparent;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    height: 34px;
    min-height: 34px;
    padding: 0;
    width: 42px;
}

.pl3d__toolField input[type="range"] {
    accent-color: var(--pl3d-accent);
    min-height: 30px;
    padding: 0;
    width: 140px;
}

.pl3d__canvasViewport {
    align-items: center;
    background:
        radial-gradient(circle at 30% 10%, rgba(255, 255, 255, .96), transparent 30%),
        linear-gradient(180deg, rgba(255, 252, 246, .98), rgba(230, 213, 188, .92));
    border: 1px solid rgba(66, 45, 24, .14);
    border-radius: 24px;
    display: flex;
    justify-content: center;
    min-height: 520px;
    overflow: hidden;
    padding: 18px;
    position: relative;
}

.pl3d__canvasViewport::before {
    background:
        linear-gradient(rgba(255, 255, 255, .2) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .18) 1px, transparent 1px);
    background-size: 22px 22px;
    content: "";
    inset: 0;
    opacity: .45;
    pointer-events: none;
    position: absolute;
}

.pl3d__canvasViewport canvas {
    border-radius: 18px;
    box-shadow: 0 28px 32px rgba(45, 29, 15, .24);
    max-height: 72vh;
    max-width: 100%;
    position: relative;
    z-index: 1;
}

.pl3d__stageHint {
    background: rgba(255, 255, 255, .62);
    border: 1px dashed rgba(66, 45, 24, .24);
    border-radius: 16px;
    color: #725941;
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
    max-width: 560px;
    padding: 12px 16px;
    text-align: center;
}

.pl3d__editorStatus {
    max-width: 100%;
}

.pl3d__resultCard > img[data-pl3d-result-image] {
    display: none;
    filter: drop-shadow(0 28px 32px rgba(45, 29, 15, .32));
    height: auto;
    max-height: 480px;
    max-width: min(92%, 760px);
    object-fit: contain;
    position: relative;
    z-index: 1;
}

.pl3d__resultCard > img[data-pl3d-result-image].is-loaded {
    animation: pl3dPreviewIn .38s ease both;
    display: block;
}

.pl3d__resultCard [data-pl3d-empty-result] {
    background: rgba(255, 255, 255, .62);
    border: 1px dashed rgba(66, 45, 24, .24);
    border-radius: 22px;
    color: #725941;
    font-size: 15px;
    line-height: 1.7;
    margin: 0;
    max-width: 420px;
    padding: 28px;
    position: relative;
    z-index: 1;
}

.pl3d__photopea {
    border: 0;
    height: 768px;
    left: -1200px;
    opacity: .01;
    pointer-events: none;
    position: fixed;
    top: -1200px;
    width: 1024px;
    z-index: -1;
}

.pl3d.is-busy .pl3d__resultCard::after {
    animation: pl3dSpin .8s linear infinite;
    border: 3px solid rgba(30, 25, 18, .14);
    border-top-color: var(--pl3d-dark);
    border-radius: 999px;
    content: "";
    height: 42px;
    position: absolute;
    right: 28px;
    top: 28px;
    width: 42px;
}

.pl3d.is-image-mode .pl3d__psLayout {
    grid-template-columns: 1fr;
}

.pl3d.is-image-mode {
    background:
        radial-gradient(circle at 12% 0%, rgba(255, 255, 255, .76), transparent 24%),
        linear-gradient(150deg, #f4eadb 0%, #d6b37c 100%);
    border-radius: 18px;
    max-width: 1800px;
    padding: clamp(8px, 1.5vw, 18px);
}

.pl3d.is-image-mode .pl3d__hero {
    align-items: center;
    border-radius: 18px;
    margin-bottom: 10px;
    min-height: 0;
    padding: 10px 14px;
}

.pl3d.is-image-mode .pl3d__eyebrow,
.pl3d.is-image-mode .pl3d__hero h1,
.pl3d.is-image-mode .pl3d__hero p:last-child,
.pl3d.is-image-mode .pl3d__previewLabel,
.pl3d.is-image-mode .pl3d__resultCard h2,
.pl3d.is-image-mode .pl3d__stageHint {
    display: none;
}

.pl3d.is-image-mode .pl3d__hero::before {
    color: #2d2115;
    content: "修改包装设计";
    font-size: 18px;
    font-weight: 900;
    letter-spacing: .02em;
}

.pl3d.is-image-mode .pl3d__actions {
    margin-left: auto;
    min-width: 0;
}

.pl3d.is-image-mode .pl3d__button {
    min-height: 38px;
    padding: 10px 16px;
}

.pl3d.is-image-mode .pl3d__panel {
    display: none;
}

.pl3d.is-image-mode .pl3d__easyPreview,
.pl3d.is-image-mode .pl3d__resultCard {
    min-height: calc(100vh - 120px);
}

.pl3d.is-image-mode .pl3d__resultCard {
    align-items: stretch;
    border-radius: 20px;
    justify-content: flex-start;
    padding: 12px;
    text-align: left;
}

.pl3d.is-image-mode .pl3d__resultCard::before {
    display: none;
}

.pl3d.is-image-mode .pl3d__editorShell {
    gap: 10px;
    max-width: 100%;
}

.pl3d.is-image-mode .pl3d__editorToolbar {
    background: rgba(255, 253, 248, .92);
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(45, 29, 15, .12);
    justify-content: flex-start;
    padding: 10px;
    position: sticky;
    top: 8px;
    z-index: 5;
}

.pl3d.is-image-mode .pl3d__toolButton {
    min-height: 34px;
    padding: 8px 12px;
}

.pl3d.is-image-mode .pl3d__toolField {
    gap: 6px;
}

.pl3d.is-image-mode .pl3d__toolField select {
    min-height: 34px;
}

.pl3d.is-image-mode .pl3d__toolField input[type="range"] {
    width: 118px;
}

.pl3d.is-image-mode .pl3d__canvasViewport {
    align-items: flex-start;
    border-radius: 18px;
    min-height: calc(100vh - 225px);
    overflow: auto;
    padding: 14px;
}

.pl3d.is-image-mode .pl3d__canvasViewport canvas {
    max-height: none;
}

.pl3d.is-image-mode .pl3d__editorStatus {
    font-size: 12px;
    opacity: .82;
    padding: 7px 10px;
}

.pl3d.is-image-mode .pl3d__editorStatus.is-success {
    background: rgba(255, 255, 255, .45);
    border-color: rgba(44, 122, 72, .18);
}

.pl3d--product-bound.is-image-mode {
    border-radius: 12px;
    padding: 8px;
}

.pl3d--product-bound.is-image-mode .pl3d__hero {
    background: rgba(255, 253, 248, .92);
    box-shadow: 0 10px 28px rgba(45, 29, 15, .1);
}

.pl3d--product-bound.is-image-mode .pl3d__button[data-pl3d-download-result] {
    display: none;
}

.pl3d--product-bound.is-image-mode .pl3d__toolField:has([data-pl3d-template-scale]) {
    display: none;
}

.pl3d--product-bound.is-image-mode .pl3d__easyPreview,
.pl3d--product-bound.is-image-mode .pl3d__resultCard {
    min-height: calc(100vh - 86px);
}

.pl3d--product-bound.is-image-mode .pl3d__resultCard {
    padding: 8px;
}

.pl3d--product-bound.is-image-mode .pl3d__editorToolbar {
    gap: 8px;
    padding: 8px;
}

.pl3d--product-bound.is-image-mode .pl3d__toolButton--save {
    background: #1f2a18;
    border-color: #1f2a18;
    color: #fff8eb;
    margin-left: auto;
}

.pl3d--product-bound.is-image-mode .pl3d__canvasViewport {
    min-height: calc(100vh - 170px);
}

.packlite-design-entry {
    margin: 12px 0;
}

.packlite-design-entry__button {
    text-align: center;
}

@keyframes pl3dPreviewIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pl3dSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 980px) {
    .pl3d {
        border-radius: 24px;
        padding: 14px;
    }

    .pl3d__hero,
    .pl3d__psLayout {
        display: block;
    }

    .pl3d__actions {
        justify-content: flex-start;
        margin-top: 22px;
        min-width: 0;
    }

    .pl3d__panel {
        margin-bottom: 18px;
    }

    .pl3d__easyPreview,
    .pl3d__resultCard {
        min-height: 460px;
    }

    .pl3d__resultCard > img[data-pl3d-result-image] {
        max-height: 330px;
    }

    .pl3d__editorToolbar {
        justify-content: flex-start;
    }

    .pl3d__canvasViewport {
        min-height: 360px;
        padding: 12px;
    }
}

@media (max-width: 560px) {
    .pl3d__hero {
        border-radius: 22px;
        padding: 22px;
    }

    .pl3d__button {
        width: 100%;
    }

    .pl3d__panel,
    .pl3d__resultCard {
        border-radius: 22px;
    }

    .pl3d__editorToolbar {
        gap: 8px;
        padding: 12px;
    }

    .pl3d__toolButton {
        min-height: 36px;
        padding: 9px 12px;
    }

    .pl3d__toolField {
        width: 100%;
    }

    .pl3d__toolField select,
    .pl3d__toolField input[type="range"] {
        flex: 1;
        width: auto;
    }
}
