 
.modal {
    display: none; /* 預設隱藏 */
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    backdrop-filter: blur(4px);
    overflow-y: auto;
}

.modal.show {
    display: flex;
}

/* 內容容器 */
.dialog {
    width: 100%;
    max-width: 880px; /* ← 尺寸加大 */
    background: var(--bg, #fff);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.06);
    max-height: 90vh;
    overflow-y: auto;
}

/* 只在合規視窗隱藏「×」按鈕，避免誤關 */
#compliance-modal .close {
    display: none !important;
}

.modal-content {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.15);
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    position: relative;
    margin: auto;
}

/* 關閉鈕（僅 access-modal 會看到） */
.close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    z-index: 10001;
    color: #94a3b8;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

    .close:hover {
        color: #000;
        background: #fff;
        transform: scale(1.1);
    }

    .close:active {
        transform: scale(0.95);
    }

.dialog-body {
    padding: 32px 32px 24px;
}

.dialog-footer {
    padding: 0 32px 32px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn {
    appearance: none;
    border: 0;
    border-radius: 12px;
    padding: 10px 18px;
    cursor: pointer;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(90deg, #f97316, #f59e0b);
    box-shadow: 0 6px 14px rgba(249,115,22,.35);
    font-weight: 600;
}

.btn-ghost {
    background: #fff;
    color: #111;
    border: 1px solid #e5e7eb;
}

@media (max-width: 768px) {
    .modal {
        padding: 15px;
    }

    .dialog {
        max-width: 100%;
        border-radius: 16px;
    }

    .dialog-body {
        padding: 28px 20px 20px;
    }

    .dialog-footer {
        padding: 0 20px 20px;
    }
}

@media (max-width: 520px) {
    .modal {
        padding: 10px;
    }

    .dialog {
        border-radius: 12px;
    }

    .dialog-body {
        padding: 24px 16px 16px;
    }

    .dialog-footer {
        padding: 0 16px 16px;
        flex-direction: column-reverse;
    }

    .btn {
        width: 100%;
    }
}

/* 進場動畫（可選） */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

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

.dialog {
    animation: fadeIn .2s ease-out;
}

/* 內容安全區域確保 */
.dialog-body > *:first-child {
    margin-top: 0;
}

.dialog-body > *:last-child {
    margin-bottom: 0;
}

 
