/* AI image 专属预览与历史面板 */
body.photo-ai3d-reference-page.photo-creative-active .c_main > .c_r {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body.photo-ai3d-reference-page.photo-creative-active .photo-result-shell {
    gap: var(--creative-shell-gap);
}

body.photo-ai3d-reference-page.photo-creative-active #normal-result-panel.normal-result-panel {
    border: 1px solid var(--photo-result-grid-border, var(--creative-panel-border-soft));
    border-radius: 11px;
    /* PHOTO_RESULT_THEME_GRID: quiet theme-colored grid for idle/result contrast. */
    background-color: #17140d !important;
    background-color: var(--photo-result-grid-bg, #17140d) !important;
    background-image:
        linear-gradient(var(--photo-result-grid-line, #6b6040) 1px, transparent 1px),
        linear-gradient(90deg, var(--photo-result-grid-line, #6b6040) 1px, transparent 1px) !important;
    background-size: 36px 36px, 36px 36px !important;
    background-position: -1px -1px, -1px -1px !important;
    color: var(--photo-result-grid-title, #ffefc0);
    padding: 46px 27px 22px;
}

body.photo-ai3d-reference-page.photo-creative-active .normal-result-panel::before {
    content: "预览画布";
    position: absolute;
    top: 19px;
    left: 22px;
    z-index: 4;
    color: var(--photo-result-grid-title, #ffefc0);
    font-size: 13px;
    font-weight: 800;
}

body.photo-ai3d-reference-page.photo-creative-active .normal-result-image-wrap {
    position: relative;
    z-index: 2;
    display: none;
    align-items: center;
    justify-content: center;
    width: min(100%, 944px);
    height: calc(100% - 59px);
    min-height: 0;
    margin-top: 16px;
}

body.photo-ai3d-reference-page.photo-creative-active .normal-result-panel.has-image .normal-result-image-wrap {
    display: flex;
}

body.photo-ai3d-reference-page.photo-creative-active .normal-result-panel .normal-result-image {
    max-width: 100%;
    max-height: 100%;
    border: 0;
    border-radius: 10px;
    box-shadow: 0 0 24px rgba(60, 121, 255, 0.22);
    transform: none;
    object-fit: contain;
}

body.photo-ai3d-reference-page.photo-creative-active .normal-result-actions {
    right: 38px;
    bottom: 30px;
    gap: 19px;
}

body.photo-ai3d-reference-page.photo-creative-active .normal-result-download {
    display: none !important;
}

body.photo-ai3d-reference-page.photo-creative-active .normal-result-download-pin,
body.photo-ai3d-reference-page.photo-creative-active .normal-result-hover-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(95, 145, 255, 0.72);
    color: #ffffff;
    text-decoration: none;
    cursor: pointer;
    appearance: none;
    outline: none;
}

body.photo-ai3d-reference-page.photo-creative-active .normal-result-download-pin {
    display: none;
    position: absolute;
    top: 11px;
    right: 11px;
    z-index: 5;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(28, 51, 92, 0.82);
    box-shadow: 0 8px 18px rgba(4, 12, 28, 0.34);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* 仅在有结果（含预览失败但可下载）时显示下载钉 */
body.photo-ai3d-reference-page.photo-creative-active .normal-result-panel.has-image .normal-result-download-pin {
    display: inline-flex;
}

body.photo-ai3d-reference-page.photo-creative-active .normal-result-download-pin svg,
body.photo-ai3d-reference-page.photo-creative-active .normal-result-hover-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

body.photo-ai3d-reference-page.photo-creative-active .normal-result-hover-actions {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 19px;
    border-radius: 10px;
    background: rgba(4, 11, 24, 0.26);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}

body.photo-ai3d-reference-page.photo-creative-active .normal-result-image-wrap:hover .normal-result-hover-actions,
body.photo-ai3d-reference-page.photo-creative-active .normal-result-image-wrap:focus-within .normal-result-hover-actions {
    opacity: 1;
    pointer-events: auto;
}

body.photo-ai3d-reference-page.photo-creative-active .normal-result-hover-btn {
    width: 58px;
    height: 58px;
    padding: 0;
    border-radius: 13px;
    background: rgba(19, 37, 72, 0.88);
    box-shadow: 0 14px 29px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

body.photo-ai3d-reference-page.photo-creative-active .normal-result-hover-btn:hover {
    transform: translateY(-2px);
    background: rgba(45, 91, 176, 0.94);
    border-color: rgba(145, 185, 255, 0.98);
}

body.photo-ai3d-reference-page.photo-creative-active .normal-result-hover-btn svg {
    width: 27px;
    height: 27px;
}

body.photo-ai3d-reference-page.photo-creative-active .photo-history-panel {
    flex: 0 0 var(--creative-history-width);
    width: var(--creative-history-width);
    border: 1px solid var(--creative-panel-border-soft);
    border-radius: 11px;
    background: var(--creative-panel-bg);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

body.photo-ai3d-reference-page.photo-creative-active .photo-history-header {
    min-height: 46px;
    padding: 0 14px;
    border-bottom: 0;
}

body.photo-ai3d-reference-page.photo-creative-active .photo-history-header strong {
    font-size: 14px;
}

body.photo-ai3d-reference-page.photo-creative-active .photo-history-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

body.photo-ai3d-reference-page.photo-creative-active .photo-history-header span {
    min-width: 35px;
    height: 22px;
    padding: 0 10px;
    color: rgba(215, 226, 248, 0.94);
    line-height: 22px;
    font-size: 13px;
    font-weight: 800;
    background: rgba(64, 82, 128, 0.88);
}

body.photo-ai3d-reference-page.photo-creative-active .photo-history-clear-icon {
    width: 24px;
    height: 24px;
    border: 1px solid rgba(83, 104, 148, 0.58);
    border-radius: 50%;
    background: rgba(14, 22, 38, 0.72);
    color: rgba(190, 204, 229, 0.78);
    cursor: pointer;
}

body.photo-ai3d-reference-page.photo-creative-active .photo-history-list {
    --photo-history-list-gap: 6px;
    padding: 0 9px 8px;
}

body.photo-ai3d-reference-page.photo-creative-active .photo-history-list__virtual {
    gap: var(--photo-history-list-gap);
}

body.photo-ai3d-reference-page.photo-creative-active .photo-history-item {
    min-height: 0;
    padding: 0;
    border-color: rgba(57, 78, 124, 0.74);
    border-radius: 10px;
    background: rgba(14, 24, 43, 0.82);
}

body.photo-ai3d-reference-page.photo-creative-active .photo-history-item.is-active,
body.photo-ai3d-reference-page.photo-creative-active .photo-history-item:hover {
    border-color: rgba(37, 133, 255, 0.98);
    box-shadow: inset 0 0 0 1px rgba(37, 133, 255, 0.38), 0 10px 18px rgba(0, 12, 28, 0.28);
}

body.photo-ai3d-reference-page.photo-creative-active .photo-history-item__thumb {
    width: 100%;
    height: auto;
    border-radius: inherit;
    box-sizing: border-box;
    padding: 0;
}

body.photo-ai3d-reference-page.photo-creative-active .photo-history-clearbar {
    flex: 0 0 35px;
    padding: 0 9px 8px;
}

body.photo-ai3d-reference-page.photo-creative-active .photo-history-clear-btn {
    width: 100%;
    height: 30px;
    border: 1px solid rgba(73, 94, 141, 0.56);
    border-radius: 9px;
    background: rgba(21, 30, 49, 0.86);
    color: rgba(190, 204, 229, 0.78);
    font-size: 12px;
    cursor: pointer;
}

@media screen and (max-width: 1320px) {
    body.photo-ai3d-reference-page.photo-creative-active {
        --creative-left-column-width: 280px;
        --creative-left-card-offset: 0px;
        --creative-history-width: 192px;
        --creative-shell-gap: 10px;
    }

    body.photo-ai3d-reference-page.photo-creative-active .creative-image-option-grid.ratio-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* PHOTO_785X1396_CREATIVE_THREE_ZONE_GUARD: remap the creative Photo page into top controls, middle result, bottom history for the user's tall 785x1396 browser window. */
@media screen and (min-width: 760px) and (max-width: 780px) and (min-height: 1220px) and (max-height: 1265px) {
    body.photo-ai3d-reference-page.photo-creative-active .c_main {
        display: grid !important;
        grid-template-rows: 396px minmax(0, 1fr) !important;
        gap: 18px !important;
        padding: 12px !important;
        overflow: hidden !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .c_main > .c_l,
    body.photo-ai3d-reference-page.photo-creative-active .c_main > .c_r {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .c_main > .c_l {
        flex: 0 0 auto !important;
        grid-row: 1 !important;
        height: 396px !important;
        max-height: 396px !important;
        min-height: 0 !important;
        position: relative !important;
        z-index: 3 !important;
        overflow: hidden !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .c_main > .c_l .parmaStyle {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        max-height: 100% !important;
        margin-left: 0 !important;
        padding: 10px !important;
        gap: 12px !important;
        border: 1px solid var(--creative-panel-border) !important;
        border-radius: 12px !important;
        background: var(--creative-panel-bg) !important;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025), 0 18px 38px rgba(0, 0, 0, 0.22) !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    /* Keep a single outer card only. Nested left/param shells stay transparent. */
    body.photo-ai3d-reference-page.photo-creative-active .c_main > .c_l .left-primary-panel,
    body.photo-ai3d-reference-page.photo-creative-active .photo-param-dock {
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        align-self: stretch !important;
        max-height: 100% !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .c_main > .c_l .left-primary-panel {
        display: grid !important;
        grid-template-rows: minmax(0, 1fr) auto !important;
        gap: 6px !important;
        width: 100% !important;
        min-height: 0 !important;
        height: 100% !important;
        padding: 0 !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .c_main > .c_l .left-top-panel {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        scrollbar-width: none !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .c_main > .c_l .left-top-panel::-webkit-scrollbar,
    body.photo-ai3d-reference-page.photo-creative-active .photo-param-dock::-webkit-scrollbar {
        width: 0 !important;
        height: 0 !important;
        display: none !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .uploadAdd.tc,
    body.photo-ai3d-reference-page.photo-creative-active .js-uploader__box,
    body.photo-ai3d-reference-page.photo-creative-active .uploadAdd .uploader__file-list:not(:empty),
    body.photo-ai3d-reference-page.photo-creative-active .uploader__file-list__item,
    body.photo-ai3d-reference-page.photo-creative-active .uploader__file-list__item:only-child {
        height: 120px !important;
        min-height: 120px !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .uploader__file-list__thumbnail .thumbnail {
        height: 100% !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .photo-model-select-row {
        grid-template-columns: 74px minmax(0, 1fr) !important;
        column-gap: 10px !important;
        margin-top: 8px !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .photo-model-select-row .title {
        font-size: 13px !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .c_main > .c_l .left-bottom-panel {
        position: static !important;
        margin-top: 0 !important;
        padding: 6px 0 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .left-bottom-panel .submit-gen-btn {
        min-height: 38px !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .photo-param-dock {
        flex: 0 0 auto !important;
        width: 100% !important;
        min-width: 0 !important;
        height: 100% !important;
        min-height: 0 !important;
        max-height: none !important;
        padding: 10px !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        scrollbar-width: none !important;
        box-sizing: border-box !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .creative-image-param-panel {
        margin-top: 0 !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .creative-image-param-section:first-child {
        margin-top: 0 !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .creative-image-param-section {
        margin-top: 6px !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .creative-image-option-grid.resolution-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .creative-image-option-grid.ratio-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .creative-image-param-option {
        min-height: 32px !important;
        padding: 3px 2px !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .photo-prompt-card {
        margin-top: 6px !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .photo-prompt-input {
        min-height: 58px !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .photo-prompt-action-row {
        gap: 6px !important;
        margin-top: 6px !important;
        flex-wrap: nowrap !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .photo-prompt-action {
        min-height: 28px !important;
        padding: 0 8px !important;
        font-size: 11px !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .c_main > .c_r {
        flex: 1 1 auto !important;
        grid-row: 2 !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: hidden !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        position: relative !important;
        z-index: 1 !important;
        margin-top: 0 !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .c_main > .c_r .resultPart,
    body.photo-ai3d-reference-page.photo-creative-active .photo-result-shell {
        height: 100% !important;
        min-height: 0 !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .photo-result-shell {
        display: grid !important;
        grid-template-rows: minmax(0, 1fr) 150px !important;
        gap: 12px !important;
        padding-top: 2px !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .photo-result-workspace {
        grid-row: 1 !important;
        flex: none !important;
        min-height: 0 !important;
        height: 100% !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .normal-result-panel,
    body.photo-ai3d-reference-page.photo-creative-active #ds-result-panel {
        height: 100% !important;
        min-height: 0 !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .photo-history-panel {
        grid-row: 2 !important;
        flex: none !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 150px !important;
        min-height: 150px !important;
        max-height: 150px !important;
        position: relative !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .photo-history-header {
        min-height: 34px !important;
        padding: 8px 58px 6px 12px !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .photo-history-clear-icon {
        display: none !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .photo-history-clearbar {
        position: absolute !important;
        top: 7px !important;
        right: 9px !important;
        z-index: 3 !important;
        flex: 0 0 auto !important;
        padding: 0 !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .photo-history-clear-btn {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 38px !important;
        min-width: 38px !important;
        height: 38px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        font-size: 0 !important;
        line-height: 1 !important;
        pointer-events: auto !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .photo-history-clear-btn::before {
        content: "\1F5D1" !important;
        font-size: 15px !important;
        line-height: 1 !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .photo-history-list {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: 6px 12px 6px !important;
        scrollbar-width: thin !important;
        scrollbar-color: rgba(83, 145, 220, 0.58) rgba(7, 18, 34, 0.24) !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .photo-history-list__virtual {
        display: flex !important;
        flex-direction: row !important;
        align-items: stretch !important;
        width: max-content !important;
        min-width: 100% !important;
        gap: 10px !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .photo-history-item {
        flex: 0 0 112px !important;
        width: 112px !important;
        min-width: 112px !important;
        max-width: 112px !important;
        border-radius: 11px !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .photo-history-item__thumb {
        width: 112px !important;
        height: 70px !important;
        aspect-ratio: auto !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .photo-history-item__thumb img {
        object-fit: cover !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .photo-history-empty {
        padding: 0 12px 12px !important;
        min-height: 86px !important;
        display: none;
        align-items: center !important;
        justify-content: center !important;
    }

    body.photo-ai3d-reference-page.photo-creative-active .photo-history-panel.is-empty .photo-history-empty {
        display: flex !important;
    }
}
