html.ai-remix-modal-open,
body.ai-remix-modal-open {
    overflow: hidden;
}

.action-buttons.has-ai-remix .action-button {
    flex-basis: calc((100% - 45px) / 4);
}

.action-buttons .make-same-style-btn {
    background: linear-gradient(145deg, #fff3f7, #f5f0ff);
    color: #e93254;
}

.action-buttons .make-same-style-btn:hover {
    background: linear-gradient(145deg, #ff385c, #8b4de8);
    color: #fff;
}

html.jimeng-guide-modal-open,
body.jimeng-guide-modal-open {
    overflow: hidden;
}

.jimeng-guide-modal {
    position: fixed;
    inset: 0;
    z-index: 10090;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: max(110px, 10vh) 24px 32px;
}

.jimeng-guide-modal.is-open {
    display: flex;
}

.jimeng-guide-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 12, 18, .72);
    backdrop-filter: blur(6px);
    animation: ai-remix-fade-in .2s ease-out;
}

.jimeng-guide-dialog {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: calc(100vh - 170px);
    overflow-y: auto;
    padding: 26px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 30px 90px rgba(10, 8, 16, .3);
    color: #262b34;
    animation: ai-remix-dialog-in .25s ease-out;
}

.jimeng-guide-dialog__close {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f1f2f4;
    color: #68707c;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.jimeng-guide-dialog__header {
    padding-right: 38px;
}

.jimeng-guide-dialog__header h2 {
    margin: 0;
    color: #20242b;
    font-size: 23px;
}

.jimeng-guide-dialog__header p {
    margin: 9px 0 0;
    color: #747b86;
    font-size: 14px;
}

.jimeng-guide-steps {
    display: grid;
    gap: 12px;
    margin: 19px 0 0;
    padding: 0;
    list-style: none;
}

.jimeng-guide-step {
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fafafa;
}

.jimeng-guide-step h3 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 10px;
    color: #252a32;
    font-size: 16px;
}

.jimeng-guide-step h3 > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #e93254;
    color: #fff;
    font-size: 13px;
}

.jimeng-guide-copy-prompt,
.jimeng-guide-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 8px 16px;
    border: 0;
    border-radius: 9px;
    background: #252a32;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.jimeng-guide-copy-prompt:disabled {
    cursor: not-allowed;
    opacity: .48;
}

.jimeng-guide-copy-status {
    margin-left: 9px;
    color: #198754;
    font-size: 13px;
}

.jimeng-guide-settings {
    display: block;
}

.jimeng-guide-settings p {
    margin: 0;
    padding: 0;
    color: #39414d;
    font-size: 14px;
    line-height: 1.75;
}

.jimeng-guide-notice {
    margin: 10px 0 0;
    padding: 9px 11px;
    border-left: 3px solid #e5a318;
    background: #fff8e7;
    color: #775a18;
    font-size: 13px;
    line-height: 1.65;
}

.jimeng-guide-step > p:not(.jimeng-guide-notice) {
    margin: 0 0 13px;
    color: #68707c;
    font-size: 14px;
}

.jimeng-guide-open {
    background: #e93254;
}

.ai-remix-modal {
    position: fixed;
    inset: 0;
    z-index: 10080;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.ai-remix-modal.is-open {
    display: flex;
}

.ai-remix-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 8, 16, .72);
    backdrop-filter: blur(6px);
    animation: ai-remix-fade-in .2s ease-out;
}

.ai-remix-dialog {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    overflow-y: auto;
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 30px 90px rgba(10, 8, 16, .3);
    color: #26222c;
    animation: ai-remix-dialog-in .25s ease-out;
}

.ai-remix-dialog__close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f5f3f7;
    color: #6e6875;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.ai-remix-dialog__close:hover,
.ai-remix-dialog__close:focus {
    background: #ebe7ef;
    color: #211d26;
}

.ai-remix-dialog__header {
    padding-right: 36px;
}

.ai-remix-dialog h2 {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
}

.ai-remix-dialog__header p {
    margin: 0;
    color: #77707f;
    font-size: 14px;
    line-height: 1.7;
}

.ai-remix-form {
    margin-top: 26px;
}

.ai-remix-form > label {
    display: block;
    margin-bottom: 9px;
    font-size: 14px;
    font-weight: 700;
}

.ai-remix-input-wrap {
    position: relative;
}

.ai-remix-input-wrap textarea {
    display: block;
    width: 100%;
    min-height: 96px;
    padding: 14px 74px 14px 16px;
    border: 1px solid #ddd7e2;
    border-radius: 13px;
    outline: none;
    background: #fff;
    color: #211d26;
    font-size: 14px;
    line-height: 1.55;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.ai-remix-input-wrap textarea:focus {
    border-color: #ff385c;
    box-shadow: 0 0 0 3px rgba(255, 56, 92, .12);
}

.ai-remix-input-wrap textarea:disabled {
    background: #f6f4f7;
}

.ai-remix-counter {
    position: absolute;
    top: 14px;
    right: 16px;
    color: #9b94a1;
    font-size: 12px;
}

.ai-remix-sub-field {
    margin-top: 18px;
}

.ai-remix-sub-field > label {
    display: block;
    margin-bottom: 9px;
    font-size: 14px;
    font-weight: 700;
}

.ai-remix-sub-field .ai-remix-input-wrap textarea {
    min-height: 96px;
    padding-right: 16px;
}

.ai-remix-form__hint {
    margin: 9px 0 0;
    color: #918a97;
    font-size: 12px;
}

.ai-remix-message {
    min-height: 22px;
    margin-top: 13px;
    padding: 0;
    color: #77707f;
    font-size: 13px;
    line-height: 1.6;
}

.ai-remix-message.is-error {
    color: #d92143;
}

.ai-remix-message.is-info {
    color: #6c4bc4;
}

.ai-remix-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 52px;
    margin-top: 4px;
    padding: 12px 18px;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(135deg, #ff385c, #9b45dd);
    box-shadow: 0 10px 25px rgba(233, 50, 84, .2);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.ai-remix-submit:hover:not(:disabled) {
    filter: brightness(.96);
    transform: translateY(-1px);
}

.ai-remix-submit:disabled {
    cursor: wait;
    opacity: .72;
}

.ai-remix-submit__spinner {
    display: none;
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ai-remix-spin .75s linear infinite;
}

.ai-remix-submit__cost {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.ai-remix-submit__cost .iconfont {
    font-size: 15px;
    font-style: normal;
    line-height: 1;
}

.ai-remix-submit.is-loading .ai-remix-submit__spinner {
    display: inline-block;
}

.ai-remix-result {
    margin-top: 24px;
}

.ai-remix-result__image-wrap {
    position: relative;
    overflow: hidden;
    min-height: 220px;
    border-radius: 16px;
    background: #15121a;
}

.ai-remix-result__image-wrap img {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: contain;
}

.ai-remix-result__image-wrap span {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, .64);
    color: #fff;
    font-size: 11px;
}

.ai-remix-result__success {
    margin: 13px 0;
    color: #3f7c56;
    font-size: 13px;
    text-align: center;
}

.ai-remix-result__success a {
    display: inline-block;
    margin-left: 7px;
    color: #6c4bc4;
    font-weight: 700;
    text-decoration: none;
}

.ai-remix-result__success a:hover {
    color: #e93254;
    text-decoration: underline;
}

.ai-remix-result__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ai-remix-result__download,
.ai-remix-result__again {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.ai-remix-result__download {
    border: 0;
    background: #211d26;
    color: #fff;
}

.ai-remix-result__again {
    border: 1px solid #ddd7e2;
    background: #fff;
    color: #3e3844;
}

@keyframes ai-remix-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ai-remix-dialog-in {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

@media (max-width: 960px) {
    .action-buttons.has-ai-remix .action-button {
        flex-basis: calc((100% - 15px) / 2);
    }
}

@media (max-width: 600px) {
    .ai-remix-modal {
        align-items: flex-end;
        padding: 0;
    }

    .ai-remix-dialog {
        width: 100%;
        max-height: 90vh;
        padding: 28px 20px 22px;
        border-radius: 22px 22px 0 0;
    }

    .ai-remix-dialog h2 {
        font-size: 24px;
    }

    .ai-remix-result__actions {
        grid-template-columns: 1fr;
    }

    .jimeng-guide-modal {
        align-items: flex-end;
        padding: 0;
    }

    .jimeng-guide-dialog {
        width: 100%;
        max-height: 92vh;
        padding: 25px 18px 20px;
        border-radius: 22px 22px 0 0;
    }

}

@media (prefers-reduced-motion: reduce) {
    .ai-remix-modal__backdrop,
    .ai-remix-dialog,
    .ai-remix-submit,
    .ai-remix-submit__spinner {
        animation: none;
        transition: none;
    }
}
