/**
 * Shared modal overlay treatment.
 *
 * Keep background blur in the backdrop layer only, matching the rating modal.
 */

:root {
    --pg-modal-backdrop-background: rgba(12, 18, 24, 0.58);
    --pg-modal-backdrop-filter: blur(8px);
}

.pg-detail-pc-download-modal__backdrop {
    background: var(--pg-modal-backdrop-background) !important;
    backdrop-filter: var(--pg-modal-backdrop-filter) !important;
    -webkit-backdrop-filter: var(--pg-modal-backdrop-filter) !important;
}

.pg-detail-pc-download-modal__dialog,
.pg-detail-pc-download-modal__feedback,
.pg-detail-pc-download-modal__feedback.is-success::before,
.pg-rating-modal__dialog,
.pg-review-modal__dialog,
.pg-review-success-modal__dialog {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.pg-auth-modal[hidden] {
    display: none !important;
}

.pg-notice-modal[hidden] {
    display: none !important;
}

.pg-notice-modal {
    position: fixed;
    inset: 0;
    z-index: 11100;
    font-family: "Microsoft YaHei UI", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
}

.pg-notice-modal,
.pg-notice-modal * {
    box-sizing: border-box;
}

.pg-notice-modal__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease-in-out;
}

.pg-notice-modal__wrap {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    pointer-events: none;
}

.pg-notice-modal__dialog {
    position: relative;
    width: 90%;
    max-width: 600px;
    aspect-ratio: 4 / 3;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 0;
    border-radius: 32px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0);
    transform-origin: center center;
    pointer-events: none;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease-out;
    will-change: transform, opacity;
}

.pg-notice-modal.is-open .pg-notice-modal__backdrop {
    opacity: 1;
    pointer-events: auto;
}

.pg-notice-modal.is-open .pg-notice-modal__dialog {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    pointer-events: auto;
}

.pg-notice-modal__head {
    height: 64px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    align-items: center;
    gap: 16px;
    padding: 0 16px;
    border-bottom: 1px solid rgba(196, 199, 200, 0.25);
    background: #ededf2;
}

.pg-notice-modal__head h2 {
    margin: 0;
    color: #1a1c1f;
    font-size: 22px;
    line-height: 28px;
    font-weight: 700;
    letter-spacing: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pg-notice-modal__close {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: rgba(232, 232, 237, 0.6);
    color: #444748;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.pg-notice-modal__close:hover {
    background: #e8e8ed;
    transform: rotate(360deg);
}

.pg-notice-modal__close:active {
    transform: scale(0.9);
}

.pg-notice-modal__close .material-symbols-outlined {
    font-size: 24px;
}

.pg-notice-modal__body {
    flex: 1 1 auto;
    overflow: auto;
    padding: 40px 64px 64px;
    color: #444748;
    font-size: 17px;
    line-height: 1.7;
    text-align: center;
}

.pg-notice-modal__body > *:first-child {
    margin-top: 0;
}

.pg-notice-modal__body > *:last-child {
    margin-bottom: 0;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .pg-notice-modal__backdrop {
        background: rgba(0, 0, 0, 0.58);
    }
}

@media (max-width: 768px) {
    .pg-notice-modal__wrap {
        padding: 20px;
    }

    .pg-notice-modal__dialog {
        width: min(92vw, 600px);
        min-height: 320px;
        border-radius: 28px;
    }

    .pg-notice-modal__body {
        padding: 32px 28px 40px;
        font-size: 16px;
        line-height: 1.65;
    }
}

@media (max-width: 420px) {
    .pg-notice-modal__dialog {
        width: calc(100vw - 32px);
        min-height: 300px;
    }

    .pg-notice-modal__head {
        height: 60px;
        padding: 0 14px;
    }

    .pg-notice-modal__head h2 {
        font-size: 20px;
    }

    .pg-notice-modal__body {
        padding: 28px 22px 34px;
    }
}

@media (min-width: 769px) {
    .pg-auth-modal {
        position: fixed;
        inset: 0;
        z-index: 11050;
        display: grid;
        place-items: center;
        padding: 44px;
        font-family: "Microsoft YaHei UI", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", system-ui, sans-serif;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: geometricPrecision;
        font-synthesis-weight: none;
    }

    .pg-auth-modal,
    .pg-auth-modal * {
        box-sizing: border-box;
    }

    .pg-auth-modal__backdrop {
        position: absolute;
        inset: 0;
        background: rgba(7, 12, 22, 0.68);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        opacity: 0;
        transition: opacity 0.22s ease;
    }

    .pg-auth-modal.is-open .pg-auth-modal__backdrop {
        opacity: 1;
    }

    .pg-auth-modal__dialog {
        position: relative;
        z-index: 1;
        display: grid;
        grid-template-columns: 340px 430px;
        width: 770px;
        min-height: 500px;
        overflow: hidden;
        border: 0;
        border-radius: 24px;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 34px 100px rgba(8, 14, 28, 0.44);
        opacity: 0;
        transform: translate3d(0, 0, 0) scale(1);
        transition: opacity 0.18s ease;
        will-change: opacity;
    }

    .pg-auth-modal[data-auth-mode="register"] .pg-auth-modal__dialog {
        min-height: 640px;
    }

    .pg-auth-modal.is-open .pg-auth-modal__dialog {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }

    .pg-auth-modal__media {
        position: relative;
        min-height: inherit;
        overflow: hidden;
        background: #101827;
    }

    .pg-auth-modal__media::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 1;
        background:
            linear-gradient(180deg, rgba(3, 7, 18, 0.04) 0%, rgba(3, 7, 18, 0.12) 48%, rgba(3, 7, 18, 0.76) 100%),
            linear-gradient(90deg, rgba(3, 7, 18, 0.12) 0%, rgba(3, 7, 18, 0) 48%);
        pointer-events: none;
    }

    .pg-auth-modal__art {
        position: absolute;
        inset: 0;
        opacity: 1;
        transform: none;
        transition: none;
    }

    .pg-auth-modal__art.is-active {
        opacity: 1;
    }

    .pg-auth-modal__art img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
    }

    .pg-auth-modal__brand {
        position: absolute;
        top: 24px;
        left: 24px;
        z-index: 2;
        display: flex;
        align-items: center;
        width: 150px;
        height: 38px;
    }

    .pg-auth-modal__brand img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: contain;
        object-position: left center;
        filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.45));
    }

    .pg-auth-modal__badges {
        position: absolute;
        left: 22px;
        right: 22px;
        bottom: 24px;
        z-index: 2;
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }

    .pg-auth-modal__badges > span {
        height: 32px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 0 12px;
        border: 1px solid rgba(255, 255, 255, 0.16);
        border-radius: 999px;
        background: rgba(8, 13, 24, 0.58);
        color: #fff;
        font-size: 12px;
        font-weight: 600;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .pg-auth-modal__badges .material-symbols-outlined {
        font-size: 17px;
        color: #2ee87d;
    }

    .pg-auth-modal__badges > span:last-child .material-symbols-outlined {
        color: #ffcf33;
    }

    .pg-auth-modal__content {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
        padding: 56px 34px 34px;
        background:
            radial-gradient(circle at 94% 10%, rgba(0, 122, 255, 0.08), transparent 34%),
            linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    }

    .pg-auth-modal__close {
        position: absolute;
        top: 22px;
        right: 22px;
        z-index: 2;
        width: 40px;
        height: 40px;
        display: grid;
        place-items: center;
        border: 1px solid #e4e9f2;
        border-radius: 50%;
        background: #f7f8fb;
        color: #667085;
        cursor: pointer;
        transition: background 0.18s ease, color 0.18s ease;
    }

    .pg-auth-modal__close:hover {
        background: #edf2f8;
        color: #111827;
    }

    .pg-auth-modal__close .material-symbols-outlined {
        font-size: 24px;
    }

    .pg-auth-panel[hidden] {
        display: none !important;
    }

    .pg-auth-panel {
        width: 360px;
        animation: pgAuthPanelIn 0.2s ease both;
    }

    .pg-auth-panel__head {
        margin: 0 0 28px;
    }

    .pg-auth-panel__head h2 {
        margin: 0;
        color: #0f1728;
        font-family: "Microsoft YaHei UI", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", system-ui, sans-serif;
        font-size: 30px;
        line-height: 1.16;
        font-weight: 700;
        letter-spacing: 0;
        text-shadow: none;
    }

    .pg-auth-panel__head p {
        margin: 10px 0 0;
        color: #707b8f;
        font-size: 14px;
        font-weight: 400;
        line-height: 1.55;
    }

    .pg-auth-panel--register .pg-auth-panel__head {
        margin-bottom: 18px;
    }

    .pg-auth-form {
        width: 360px;
        display: flex;
        flex-direction: column;
        gap: 13px;
    }

    .pg-auth-panel--register .pg-auth-form {
        gap: 10px;
    }

    .pg-auth-field {
        width: 360px;
        display: block;
        margin: 0;
    }

    .pg-auth-input-wrap {
        width: 360px;
        height: 56px;
        display: flex;
        align-items: center;
        border: 0;
        border-radius: 28px;
        background: #f0f0f4;
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.86),
            inset 0 0 0 1px rgba(226, 229, 236, 0.22),
            0 10px 22px rgba(15, 23, 42, 0.035);
        padding: 0 20px;
        transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    }

    .pg-auth-input-wrap:focus-within {
        background: #fff;
        box-shadow:
            0 0 0 3px rgba(0, 122, 255, 0.13),
            inset 0 0 0 1px rgba(0, 122, 255, 0.28),
            0 12px 24px rgba(15, 23, 42, 0.06);
    }

    .pg-auth-field__icon {
        flex: 0 0 auto;
        margin-right: 15px;
        color: #657187;
        font-size: 22px;
    }

    .pg-auth-input {
        flex: 1 1 auto;
        min-width: 0;
        height: 100%;
        border: 0;
        outline: 0;
        background: transparent;
        color: #101827;
        font-size: 15px;
        font-weight: 400;
        letter-spacing: 0;
    }

    .pg-auth-input::placeholder {
        color: #7f899c;
        font-weight: 400;
        opacity: 1;
    }

    /* Keep the custom visibility control as the only password toggle in Edge. */
    .pg-auth-input[type="password"]::-ms-reveal,
    .pg-auth-input[type="password"]::-ms-clear {
        display: none;
    }

    .pg-auth-toggle,
    .pg-auth-inline-action {
        flex: 0 0 auto;
        border: 0;
        background: transparent;
        cursor: pointer;
    }

    .pg-auth-toggle {
        width: 36px;
        height: 36px;
        display: grid;
        place-items: center;
        margin-right: -10px;
        border-radius: 50%;
        color: #758092;
    }

    .pg-auth-toggle:hover {
        background: rgba(0, 122, 255, 0.08);
        color: #007aff;
    }

    .pg-auth-toggle .material-symbols-outlined {
        font-size: 21px;
    }

    .pg-auth-inline-action {
        height: 36px;
        min-width: 96px;
        margin-right: -8px;
        padding: 0 10px;
        border-radius: 18px;
        color: #007aff;
        font-size: 14px;
        font-weight: 600;
        white-space: nowrap;
    }

    .pg-auth-inline-action:hover {
        background: rgba(0, 122, 255, 0.08);
    }

    .pg-auth-inline-action:disabled {
        color: #9ba4b5;
        cursor: not-allowed;
    }

    .pg-auth-error {
        display: none;
        margin: 6px 8px 0;
        color: #d92d20;
        font-size: 12px;
        font-weight: 500;
        line-height: 16px;
    }

    .pg-auth-field.is-error .pg-auth-error {
        display: block;
    }

    .pg-auth-field.is-error .pg-auth-input-wrap {
        background: #fff1f1;
        box-shadow: inset 0 0 0 1px rgba(255, 59, 48, 0.38), 0 10px 22px rgba(255, 59, 48, 0.08);
    }

    .pg-auth-field.is-error .pg-auth-field__icon,
    .pg-auth-field.is-error .pg-auth-toggle,
    .pg-auth-field.is-error .pg-auth-inline-action {
        color: #ff3b30;
    }

    .pg-auth-field.is-error .pg-auth-input::placeholder {
        color: #ff3b30;
        opacity: 1;
    }

    .pg-auth-options {
        width: 360px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin: 0 0 5px;
        color: #7c8797;
        font-size: 14px;
        font-weight: 400;
    }

    .pg-auth-remember {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
    }

    .pg-auth-remember input {
        width: 16px;
        height: 16px;
        margin: 0;
        appearance: none;
        border: 1px solid #cbd3df;
        border-radius: 5px;
        background: #fff;
    }

    .pg-auth-remember input:checked {
        background: #007aff;
        border-color: #007aff;
        box-shadow: inset 0 0 0 3px #fff;
    }

    .pg-auth-options button,
    .pg-auth-switch-text button {
        border: 0;
        background: transparent;
        color: #007aff;
        font: inherit;
        font-weight: 600;
        cursor: pointer;
        padding: 0;
    }

    .pg-auth-submit {
        width: 360px;
        height: 56px;
        border: 0;
        border-radius: 28px;
        background: #007aff;
        color: #fff;
        box-shadow: 0 14px 24px rgba(0, 122, 255, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.18);
        cursor: pointer;
        font-size: 16px;
        font-weight: 700;
        letter-spacing: 0;
        text-shadow: none;
        transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
    }

    .pg-auth-submit:hover {
        transform: translateY(-1px);
        box-shadow: 0 15px 26px rgba(0, 122, 255, 0.32);
    }

    .pg-auth-submit:active {
        transform: translateY(0);
    }

    .pg-auth-submit:disabled {
        opacity: 0.72;
        cursor: wait;
    }

    .pg-auth-switch-text {
        width: 360px;
        margin: 21px 0 0;
        text-align: center;
        color: #7c8797;
        font-size: 14px;
        font-weight: 400;
    }

    .pg-auth-panel--register .pg-auth-switch-text {
        margin-top: 14px;
    }

    @keyframes pgAuthPanelIn {
        from {
            opacity: 0;
            transform: translateY(8px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

}

@media (max-width: 768px) {
    .pg-auth-modal {
        display: none !important;
    }
}
