body {
    margin: 0;
    padding: 0;
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#main {
    width: 100vw;
    height: 100vh;
    position: relative;
}

.modal {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: transparent;
    border-radius: 0;
    padding: 0;
    text-align: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    box-sizing: border-box;
    width: auto;
    height: auto;
}

.modal.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: all;
}

.mac-style {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    padding: 20px 15px;
    min-width: 100px;
    max-width: 45vw;
    box-sizing: border-box;
}

.modal-content {
    position: relative;
}

.modal-content h2 {
    margin: 0 0 15px;
    color: #333;
    font-size: 20px;
}

.modal-content p {
    margin: 0 0 20px;
    color: #666;
    line-height: 1.5;
    font-size: 16px;
}

/* 手机适配 */
@media (max-width: 300px) {
    .mac-style {
        padding: 25px 20px;
        min-width: 260px;
        max-width: 85vw;
    }

    .modal-content h2 {
        font-size: 18px;
        margin: 0 0 12px;
    }

    .modal-content p {
        font-size: 15px;
        margin: 0 0 18px;
    }

    button {
        padding: 12px 30px;
        font-size: 15px;
    }

    .message-modal {
        padding: 3px 6px;
        width: 50px;
        min-height: 14px;
        font-size: 11px;
        border-radius: 6px;
        /* 在移动设备上禁用 backdrop-filter 以提高性能 */
        backdrop-filter: none;
        background: rgba(255, 255, 255, 0.98);
    }

    .modal {
        transform: translate(-50%, -50%) scale(0.9);
    }

    .modal.show {
        transform: translate(-50%, -50%) scale(1);
    }
}

button {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.2);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.3);
}

.message-modal {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    padding: 4px 8px;
    width: 57px;
    min-height: 16px;
    text-align: center;
    transition: transform 0.4s ease-out, opacity 0.4s ease-out;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.85);
    box-sizing: border-box;
    word-wrap: break-word;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform, opacity;
    contain: layout style paint;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 13px;
    line-height: 1.3;
}

/* 基础显示动画 */
.message-modal.show {
    opacity: 1;
}

/* 淡入动画 */
.animation-fade {
    transform: translate(-50%, -50%) scale(0.85);
    transition: transform 0.4s ease-out, opacity 0.4s ease-out;
}

.animation-fade.show {
    transform: translate(-50%, -50%) scale(1);
}

/* 缩放动画 */
.animation-scale {
    transform: translate(-50%, -50%) scale(0.3);
    transition: transform 0.4s ease-out, opacity 0.4s ease-out;
}

.animation-scale.show {
    transform: translate(-50%, -50%) scale(1);
}

/* 缩放+淡入动画 */
.animation-zoom {
    transform: translate(-50%, -50%) scale(0.5);
    transition: transform 0.4s ease-out, opacity 0.4s ease-out;
}

.animation-zoom.show {
    transform: translate(-50%, -50%) scale(1);
}